Click here to Skip to main content
15,908,264 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
I have excel sheet created via Interop (C#)
having 2 sheets,sheets 1 has customername(say 1000) as hyperlink,after click on link it moves to 2nd sheet.
I want the cell to moved(of sheet2) to display on top(first row)
My code is like this
C#
strCol = (char)(asciiChar) + rowNumber.ToString();
range = sheet.get_Range(strCol, strCol);
sheet.Hyperlinks.Add(range, "#" + sheet1.Name + "!C" + moveToRow, Type.Missing, "Go to", dsCustomer.Tables[0].Rows[i][1].ToString());0].Rows[i][1].ToString());


lets see.
in sheet 1 i have 1k customerlist with link, i have to fill sales data for items assigned to customer which i placed in sheet2 ,now if items are 100 for each customer cust1 displayed on row1 then 100 items rows and 2nd customer on row 103 and so on.
When i click on 2nd customer from sheet1 it goes to 103rd row in sheet2 and it display in middle or below in the screen and user wants to scroll it for inserting data.
My requirement is my 103rd row should displayed on top of the sheet so no need to scroll.
Your help is appreciated.
Thanks in advance
Posted
Updated 21-Mar-13 19:26pm
v2

1 solution

hi,


It is simple to using set cursor on that specified cell. U know that which cell u want to show on the top.

For an example u have select the range of the cell

strCol="A103";

range = sheet.get_Range(strCol, strCol);
ranse.select();


Try this it will work.


Regards,
Prakash.T
 
Share this answer
 
Comments
Pramilak 22-Mar-13 6:12am    
Hello,
It will not work,the row is not shifting at top,it will remains where it is.
Any other solution?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900