ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   want to advanced to cell on the right but my code won't work (https://www.excelbanter.com/excel-programming/387483-want-advanced-cell-right-but-my-code-wont-work.html)

[email protected]

want to advanced to cell on the right but my code won't work
 
Hi

What my macro should do is move to the next cell to the right when the
current cell is occuiped.

sample of my data
A1 A2
C1


Mike

want to advanced to cell on the right but my code won't work
 
Sub CellToRight()
'moves to the right if active cell is empty
ActiveCell.Select
If ActiveCell = "" Then
MsgBox "Empty"
' your code
Else
MsgBox "Move to the next cell to the right"
ActiveCell.Offset(0, 1).Select
End If

End Sub

" wrote:

Hi

What my macro should do is move to the next cell to the right when the
current cell is occuiped.

sample of my data
A1 A2
C1




All times are GMT +1. The time now is 09:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com