Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm trying to find some code that will return the row number of a variable
'Val' as 'j' and the column as 'i'. For example Call A1 i=1, j=1 I've tried the row command but i'm not having much luck... Any help appreciated. -- Dave |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub GetRowAndCol()
Dim j As Long, i As Integer, adr As String adr = "A1" j = Range(adr).Row i = Range(adr).Column MsgBox j & " " & i End Sub By the way, are you saying you're using Val as a variable name? Val is a keyword, of course, so I wouldn't use it for a variable name. James DaveyJones wrote: I'm trying to find some code that will return the row number of a variable 'Val' as 'j' and the column as 'i'. For example Call A1 i=1, j=1 I've tried the row command but i'm not having much luck... Any help appreciated. -- Dave |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Cheers, thats got it sorted. As for the keyword, I can't say I knew that, i'm
a complete newbie at this... -- Dave "Zone" wrote: Sub GetRowAndCol() Dim j As Long, i As Integer, adr As String adr = "A1" j = Range(adr).Row i = Range(adr).Column MsgBox j & " " & i End Sub By the way, are you saying you're using Val as a variable name? Val is a keyword, of course, so I wouldn't use it for a variable name. James DaveyJones wrote: I'm trying to find some code that will return the row number of a variable 'Val' as 'j' and the column as 'i'. For example Call A1 i=1, j=1 I've tried the row command but i'm not having much luck... Any help appreciated. -- Dave |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i= myVar.Row
j = myVar.Column this assumes myVar is a range variable -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "DaveyJones" wrote in message ... I'm trying to find some code that will return the row number of a variable 'Val' as 'j' and the column as 'i'. For example Call A1 i=1, j=1 I've tried the row command but i'm not having much luck... Any help appreciated. -- Dave |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
divide column(x) by column(y) to give column(x/y) in excel? | New Users to Excel | |||
Referencing date column A & time column B to get info from column | Excel Discussion (Misc queries) | |||
Return text in Column A if Column B and Column K match | Excel Worksheet Functions | |||
Based on a condition in one column, search for a year in another column, and display data from another column in the same row look | Excel Discussion (Misc queries) | |||
How can i have all alike product codes in column A be matched with like cities in column B and then add the totals that are in column C | Excel Programming |