Hi guys!
I have a sheet where when a user types something in column b the sheet auto increments and fills in column A with a unique number. I would like to start the number at 1000 rather than just 1.
Hi guys!
I have a sheet where when a user types something in column b the sheet auto increments and fills in column A with a unique number. I would like to start the number at 1000 rather than just 1.
it would be great if you provide sample workbook
Thanks - Naveed
-----------------------------
If the suggestion helps you, then Click * to Add Reputation
To Attach File: Go Advanced>>Manage Attachments>>Add Files (In Top Right Corner)>>SelectFiles>>.........Locate Your File(s)>>Upload Files>>Done (In Bottom Right)
1. Use [code] code tags [\code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
2. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.
Can you post the code that you already have?
FWIW
This uses a helper cell in this case H1. You would put the 1000 in H1, if it's useful too you.
![]()
Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Columns(2)) Is Nothing Then x = Range("H1").Value Target.Offset(, -1).Value = x Range("H1").Value = x + 1 End If End Sub
try this code :
![]()
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column = 2 And Target.Text <> "" Then Range("a" & Target.Row) = 999 + Target.Row Else If Target.Column = 2 And Target.Text = "" Then Range("a" & Target.Row).Clear End If End If End Sub
Happy Computing ,
Xlbiznes.
To show your appreciation please click *
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks