auto numbering in previous cell based on enter adjacent cell using target cell

Hasson

Active Member
Joined
Apr 8, 2021
Messages
392
Office Version
  1. 2016
Platform
  1. Windows
Hello
I have headers in row10 and data starts from row11. I want when entering data in column B , then should autonumbering in column A 1,2,3 ....
just when fill in cell for column B then should fill in previous cell in column B using target range by sheet module .
thanks
 
What I mean press when double click in the cell and don't write any thing then will write number in column A why?
 
Upvote 0

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
What I mean press when double click in the cell and don't write any thing then will write number in column A why?
Not sure what you're now asking about.
We never mentioned double clicking before.
 
Upvote 0
See if this does what you want

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
  With Target
    If .CountLarge = 1 And .Column = 2 And .Row > 10 Then
      If Len(.Value) > 0 Then .Offset(, -1).Value = Val(.Offset(-1, -1).Value) + 1
    End If
  End With
End Sub
 
Upvote 1
Solution
We never mentioned double clicking before.
yes , but you told me you don't understand my , that's why I said double click .
any way thank you and @Peter_SSs have solved it .;)
 
Upvote 0
You're welcome. Thanks for the confirmation. :)
 
Upvote 0

Forum statistics

Threads
1,216,082
Messages
6,128,700
Members
449,464
Latest member
againofsoul

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