Hello sir(s)
I was looking for a VBA code for choosing the first empty cell in a column containing some data and I came across the following code on one of the microsoft webpages.
[ https://msdn.microsoft.com/en-us/library/office/hh211481(v=office.14).aspx]
I copied it and when I ran the code, I got an error - error message uploaded as jpeg file.
Can I know why this is code is wrong ? and if wrong, how to correct it?
Thanking you in advance.
With regards
Ravi Shankar Rupanagudi
Hyderabad
I was looking for a VBA code for choosing the first empty cell in a column containing some data and I came across the following code on one of the microsoft webpages.
[ https://msdn.microsoft.com/en-us/library/office/hh211481(v=office.14).aspx]
Code:
Sub NewRecord()
' Add new record and increment the value in the first column.
Sheets("Employees").Activate
' Select the first cell after the last filled cell in column A.
Range("A1").End(xlDown).Offset(1, 0).Select
' Determine the maximum value in the column and add 1.
ActiveCell = WorksheetFunction.Max(ActiveCell.EntireColumn) + 1
End Sub
I copied it and when I ran the code, I got an error - error message uploaded as jpeg file.
Can I know why this is code is wrong ? and if wrong, how to correct it?
Thanking you in advance.
With regards
Ravi Shankar Rupanagudi
Hyderabad
Attachments
Last edited by a moderator: