Can someone help out please building a macro enabling:
in column A3 I have a unique ID "RISK_001"
The macro should insert a row and populate next entry (A4) with id "RISK_002"
Can someone help out please building a macro enabling:
in column A3 I have a unique ID "RISK_001"
The macro should insert a row and populate next entry (A4) with id "RISK_002"
I have made a first almost successfull attempt , howver the counting always starts at 002 and not 001.
Sub Add_record()
Dim lr As Long
Dim c As String
Application.ScreenUpdating = False
With Sheets("risks")
lr = .Cells(Rows.Count, "A").End(xlUp).Row
c = "Risk_" & Format(lr, "000")
.Cells(lr + 1, 1) = c
End With
Application.ScreenUpdating = True
End Sub
Subtract 1 from lr
Please Login or Register to view this content.
@rickmeister:
Please put your code between code tags, highlight the code and then click the "#" button.
Please Login or Register to view this content.
1. I care dog
2. I am a loop maniac
3. Forum rules link : Click here
3.33. Don't forget to mark the thread as solved, this is important
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks