Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Passing Dynamic value as parameter in range

  Asked By: Molly    Date: Nov 07    Category: MS Office    Views: 879
  

I to populate the data in worksheet from the database from various
sql scripts, I dont know the number of records populated by a query,
but as soon as one query is done other query should populate the
data in next row, so after every query execution i am using this code
{
LastRow = Cells.Find(What:="*", After:=[A1], _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row

LastRow = LastRow + 1
}
to get the last row. Now for another query i want to pass the
parameter for Range. please suggest what can be used??

This code which i am using is not working:


ThisWorkbook.ImportFromTable(request, name, Sheets(i).Range("B" &
LastRow), xlVertical, False)

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Grady Stewart     Answered On: Nov 07

Not clear what you're actually trying to do here. You seem to be trying to
use LastRow before you create it, but I can't tell because you have omitted
the important lines of code.

Please provide the full code  involved.

 
Didn't find what you were looking for? Find more on Passing Dynamic value as parameter in range Or get search suggestion and latest updates.




Tagged: