oldrin
asked on
locate the cell reference in a changing row scenario
When the web query refreshes, the row which contains the data changes location.
I need to include the cell in my formula. Could you please help and advise how to reference the moving row in my formula ?
In the enclosed sample file the reference cell is highlighted in yellow.
sample-to-locate-date-cell.xlsx
I need to include the cell in my formula. Could you please help and advise how to reference the moving row in my formula ?
In the enclosed sample file the reference cell is highlighted in yellow.
sample-to-locate-date-cell.xlsx
ASKER
I have not included the webquery in the sample file.
From your above 03 suggestions, the first option of "last row with data before disclaimer" would be the solution for me.
Could you please write a macro or a vb code to achieve the above ?
Thanks.
From your above 03 suggestions, the first option of "last row with data before disclaimer" would be the solution for me.
Could you please write a macro or a vb code to achieve the above ?
Thanks.
This vba code stores the value of the row number in the variable RowNmbr and the cell address in the variable CellRef
Sub FindMovingData()
'
' FindMovingData Macro
'
Cells.Find(What:="DISCLAIM ER", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activ ate
Selection.End(xlUp).Select
RowNmbr = ActiveCell.Row
CellRef = ActiveCell.Address
End Sub
Sub FindMovingData()
'
' FindMovingData Macro
'
Cells.Find(What:="DISCLAIM
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activ
Selection.End(xlUp).Select
RowNmbr = ActiveCell.Row
CellRef = ActiveCell.Address
End Sub
Hi
May be
=LOOKUP(9.9999E+307,A:A)
and format the cell
Kris
May be
=LOOKUP(9.9999E+307,A:A)
and format the cell
Kris
ASKER
Hi jkasavan,
After adding the code to the module, could you please advise how to use it in the excel worksheet ?
After adding the code to the module, could you please advise how to use it in the excel worksheet ?
What version of Excel?
How is the Web Query refresh initiated - manually? A macro? On a timed basis?
How is the Web Query refresh initiated - manually? A macro? On a timed basis?
ASKER
Version is Excel 2007
Web query refresh is manually initiated.
Web query refresh is manually initiated.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Hi jkasavan,
I am not using pivot table. I am using a webquery.
I am not using pivot table. I am using a webquery.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Hi, oldrin -
Did that work?
Did that work?
As far as I know the web query option does not allow you to reference parts of its output, so the easiest way would be to adapt the web query to only return the row you are looking for.
When this is not possible, you could use macro code to parse the results and identify the row you are looking for.
Identification can be by
If you have found out a good identification method but have problems implementing it, please let us know so that we can help you.