VBA goto cell referenced in a cell

brianfosterblack

Active Member
Joined
Nov 1, 2011
Messages
251
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
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
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
 
Upvote 0
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:
Upvote 0
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.
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,424
Members
448,961
Latest member
nzskater

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top