Move Cursor to a Specific Cell

dp724

Board Regular
Joined
Dec 16, 2006
Messages
63
I have a worksheet filled with link formulas, which will be used to importing data to Access. I'd like to set up a macro which clear certain cell contents. How can I make the cursor move to the last cell of a row, which has a value greater than zero? At the moment I can only make it move the last cell with a formula.

Thanks in advance.
Dave
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Why do you need to select the cell? Don't you just want to clear cells?
What cells need to be cleared?
 
Upvote 0
Thanks for the reply. Basically, the macro will clear contents for a range which will always be different. But it sounds like you have experience with Access and the more I think about this macro idea, the more I'm starting to believe that I really need to somehow manipulate the data that gets imported in to Access. I'm still undecided. But can you tell me how can I make the cursor move to the last cell of a row, which has a value greater than zero?
 
Upvote 0
Code:
Sub Macro4()
Last = Range("A65536").End(xlUp).Row
    For x = Last To 1 Step -1
        If Cells(x, 1).Value > 0 Then
            Cells(x, 1).Select
            Exit Sub
        End If
    Next
End Sub

that is for column A

that work for ya? just change the "A65536" to whatever column A,B,C etc

then change the Cells(x,1) <--- 1 to whatever column 1=A, 2=B, 3=C
 
Upvote 0
Thanks QuietRiot,
Works out perfectly! Only one change needed 'Cells(2, x)'.

Hotpepper,
Got my Excel question answered...thanks!
 
Upvote 0

Forum statistics

Threads
1,215,019
Messages
6,122,707
Members
449,093
Latest member
Mnur

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