VBA goto cell referenced in a cell

brianfosterblack

Board Regular
Joined
Nov 1, 2011
Messages
133
I am using Excel 2013

In cell L11 I have this formula
Address (K11,7)
This returns the address in the cell as $G$45 but the row number will change each time I loop the macro
In my code I want to go to that address and continue running the code.

to do this, I am using this code
Application.Goto Sheets("Sheet1").Range(Sheets("Sheet1").Range("L11").Value) ' cell reference of where repeats start

I am running into an error on this line of code and do not understand why

I have 2 worksheets in the workbook but Cell L11 is on the same sheet as the code is running on (sheet1) named as Log Book
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
16,427
Please explain in words with specific details what your wanting your script to do.
And I will see what I can do to help you.

Normally we should not need to use a Goto
 

brianfosterblack

Board Regular
Joined
Nov 1, 2011
Messages
133
I am running code to produce a list of random numbers.
Once I have generated the random numbers I determine the last row that a number appears in (Which is in column G)
I want to move to the last row of that list and continue running the code

One other thing I need help with is that when my code finishes, there are some Zero numbers in the range named "NumberRange". I want to remove the zeros and just leave the cell empty.
 
Last edited:

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
16,427
Show me the code your now using.

I would like to see the code which enters random numbers and also see the code you want to run after the random numbers are entered.
 

brianfosterblack

Board Regular
Joined
Nov 1, 2011
Messages
133
Thanks Yyour comment above made me decide to change my code to
Code:
Range("G1000").End(xlUp).Select
this resolved the problem
Thank you for your assistance
 

Forum statistics

Threads
1,085,546
Messages
5,384,374
Members
401,890
Latest member
Angela7

Some videos you may like

This Week's Hot Topics

Top