ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with Numbering Macro (https://www.excelbanter.com/excel-programming/378786-re-help-numbering-macro.html)

Nigel

Help with Numbering Macro
 
This simple piece of code will increment the first letter by 1 (AB etc),
for the selected range of cells. So after your insert, select all cells (in
column A) after the inserted rows and run this code.

Sub Recode()
Dim c As Range
For Each c In Selection
If Len(Trim(c)) 0 Then c = Chr(Asc(Left(c, 1)) + 1) & Mid(c, 2, Len(c) -
1)
Next
End Sub

--
Cheers
Nigel



"Sprinks" wrote in message
...
We do conceptual cost estimating for architects at early stages of design
in
Excel. We use a standard of 60 lines per page with the following section
conventions. Categories shown are just examples and vary, the # of lines
vary
since 2 or more categories may fit on a single page. What stays
consistent
is that after the last line of a category, there is a blank line followed
by
"Subtotal" in column B.

...header....

A Demolition

A1 Stairs-on-grade 1 LS $1,500.00 1,500
A2 ... other line items
A3 ....
...
An

Subtotal
20,000

-------------------------------------------------------------------------

B Foundations

B1
...
Bn

Subtotal

Frequently, due to space limitations, we find it necessary to insert a new
category, requiring that all subsequent categories need to be re-lettered,
e.g., from B, B1-Bn to C, C1-Cn, n being the last line of the category.
This
is a tedious process that I'd like to automate. I can handle the
inserting a
new page but would like help with the relettering/renumbering.

Can anyone point me in the right direction?

Thank you.
Sprinks





All times are GMT +1. The time now is 08:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com