Verzhiniya has attended:
Excel VBA Introduction course
Define a range
Hi,
I would like to define range, which will have a variable row. The idea is that I would like to choose a range up to a specific date. Using match function, I can find the row number. However, I don't know how to use this variable number to define different range every time.
Best regards,
Verzhiniya
RE: Define a range
Hi Verzhiniya,
Thank you for the forum question.
You can store the row number in a variable.
RowNumber=worksheetfunction.match("the date","The range",0)
and then you can use the range object.
Range("A" & RowNumber, "D" & RowNumber).
We have variables on our Excel VBA Intermediate course. Variables are very important to create dynamic codes.
I hope this can point you in the right direction.
Kind regards
Jens Bonde
Microsoft Office Specialist Trainer
Tel: 0207 987 3777
Best STL - https://www.stl-training.co.uk
98%+ recommend us
London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector