Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm looking for a macro that will add a zero of the first character in
column starting in the row 2 (W2 to Last row with data). Example: This: aaaaaaa bbbbbb cccccc Would look like: This a0aaaaaa b0bbbbb c0ccccc Little Penny |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Dim LastRow As Long Dim i As Long With ActiveSheet LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row For i = 2 To LastRow .Cells(i, "A").Value = Left(.Cells(i, "A").Value, 1) & "0" & _ Right(.Cells(i, "A").Value, Len(.Cells(i, "A").Value) - 1) Next i End With -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Little Penny" wrote in message ... I'm looking for a macro that will add a zero of the first character in column starting in the row 2 (W2 to Last row with data). Example: This: aaaaaaa bbbbbb cccccc Would look like: This a0aaaaaa b0bbbbb c0ccccc Little Penny |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Give this a try...
Sub AddZero() Dim X As Long Dim LastRow As Long With Worksheets("Sheet3") LastRow = .Cells(Rows.Count, "W").End(xlUp).Row For X = 2 To LastRow With .Cells(X, "W") .Value = Left(.Value, 1) & "0" & Mid(.Value, 2) End With Next End With End Sub Rick "Little Penny" wrote in message ... I'm looking for a macro that will add a zero of the first character in column starting in the row 2 (W2 to Last row with data). Example: This: aaaaaaa bbbbbb cccccc Would look like: This a0aaaaaa b0bbbbb c0ccccc Little Penny |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Adding 4 cells next to eachother and then adding the following fourcells | Excel Programming | |||
adding some rows in the middle of adding some other rows | Excel Programming | |||
Adding a new row | Excel Programming | |||
Help with adding 10% | Excel Worksheet Functions | |||
Adding Up! | Excel Discussion (Misc queries) |