![]() |
#1
|
|||
|
|||
![]()
I deleted entire 45th row, now numbering series gone wrong.
![]() |
#2
|
|||
|
|||
![]() |
#3
|
|||
|
|||
![]() Quote:
|
#4
|
|||
|
|||
![]()
.
By slightly editing the posted macro, you can achieve the goal you desire : Code:
Option Explicit Private Sub Worksheet_Change(ByVal Target As Range) Dim I As Integer I = 1 Application.EnableEvents = False For I = 1 To 50 Range("A" & I).Value = I - 1 Next Application.EnableEvents = True End Sub correct numbering in your column. Your original post indicated you are deleting one row at a time. It has been a pleasure helping you. Stay healthy ! ![]() |
#5
|
|||
|
|||
![]()
Where should I enter this code? How to activate it?
|
#6
|
|||
|
|||
![]()
.
Paste the code in the Sheet module, of the sheet you want it applied to. It functions automatically when a row is deleted. You won't have to do anything. This line in the code : For I = 1 To 50 can be changed if you want the number of affected rows changed. For example, if you want it applied to 100 rows, change the 50 to 100. If want it applied to just the first 20 rows, change the 50 to 20. |
#7
|
|||
|
|||
![]() Quote:
![]() If not, show me correct sheet module. |
#8
|
|||
|
|||
![]()
.
If that is the Sheet that you want the macro code to work on. Yes |
#9
|
|||
|
|||
![]() Quote:
Why I am getting this error while I am saving your code? ![]() ![]() |
#10
|
|||
|
|||
![]()
.
You need to save the workbook as macro-enabled. Click NO, then in the small window that opens ... choose File Type as .XLSM |
#11
|
|||
|
|||
![]() Quote:
Yes I saved my file as XLSM, saved your code in my worksheet, still numbering series didn't change: ![]() ![]() still its showing 46 instead of 45. ![]() |
#12
|
|||
|
|||
![]()
.
Can you post your workbook ? |
#13
|
|||
|
|||
![]()
Disregard posting your workbook.
Let's try a formula instead of the macro. If you don't have a header in A1, paste the following formula in A1. If you do have a header, then paste the formula in A2. If A1 : =IF(ISBLANK(B1)," ",COUNTA($B$1:B1)) If A2 : =IF(ISBLANK(B2)," ",COUNTA($B$2:B2)) Once you have the formula in the cell, click on the cell and a small dot will appear in the lower right hand corner of the cell. Hover your cursor over that tiny black dot until the cursor becomes a cross symbol. While it remains the cross, double click the dot. The formula should auto-fill all the cells in Col A that are adjacent to a cell in Col B that has some data. Be sure to delete the macro from the worksheet module. |
#14
|
|||
|
|||
![]()
My problem is arrives at A58 but you are saying A2 & B2, I am confused.
![]() |
#15
|
|||
|
|||
![]()
.
What Column and what starting and ending cell do you want the auto numbering to work ? |
![]() |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Occurence appt invitees showing on entire series | doresa69 | Outlook | 0 | 11-11-2016 01:32 PM |
![]() |
ericjowens | Excel | 2 | 09-03-2015 11:20 AM |
deleted items in wrong mailbox | Flip | Outlook | 2 | 03-12-2014 03:51 AM |
![]() |
Scaffold | Word | 2 | 02-13-2014 03:08 AM |
Continue Auto Numbering Throughout Entire Presentation | craigfu | PowerPoint | 3 | 05-04-2012 05:42 AM |