VBA to jump to next empty cell on that ROW

Adashi144

New Member
Joined
Feb 21, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Using VBA programmed into a button, I wish to be able to click any cell on any row, then when I click the button it selects the next empty cell on that row (to the right), skipping any gaps in the data....... Essentially finding the last actual cell in that row containing data then offset by 1 to the right.....

Thanks :D
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
maybe something like

VBA Code:
Sub MyCell()
Dim lcol As Long

With ActiveSheet.Rows(ActiveCell.row)
    lcol = .Find("*", .Cells(1, 1), xlValues, xlPart, xlByColumns, xlPrevious, False, False).Column
    Cells(ActiveCell.row, lcol + 1).Select
End With

End Sub
 
Upvote 0
Solution
maybe something like

VBA Code:
Sub MyCell()
Dim lcol As Long

With ActiveSheet.Rows(ActiveCell.row)
    lcol = .Find("*", .Cells(1, 1), xlValues, xlPart, xlByColumns, xlPrevious, False, False).Column
    Cells(ActiveCell.row, lcol + 1).Select
End With

End Sub
This is wonderful..... Works perfect

Thanks :D :D
 
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,215
Members
448,554
Latest member
Gleisner2

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