FlyGuyTray
Registered User.
- Local time
- Today, 16:10
- Joined
- Nov 30, 2010
- Messages
- 38
(Excel)
In column A i have numbers, that look like this: 123456-1234
I'm trying to formulate something simple that would add a 0 behind the the 8th and 10th number, so the numbers would the look like this: 123456-120340.. And i would like to every row in the column.
I'm not a "coder" by no means, but I did some fumbling around the internet and came up with this:
Sub Gridnumbers()
Application.ScreenUpdating = False
List = Selection.Rows.Count
For i = List To 1 Step -1
temp = ActiveCell
ActiveCell.Offset(1, 0).Select
x = Right(temp, 2)
y = concatenate("0", x, "0")
z = Mid(temp, 7, 2)
last = concatenate(z, y)
first = Left(temp, 6)
ActiveCell = concatenate(first, last)
ActiveCell.Offset(-i, 0).Select
Next i
Application.ScreenUpdating = True
End Sub
Needless to say, it doesn't work :-(
In column A i have numbers, that look like this: 123456-1234
I'm trying to formulate something simple that would add a 0 behind the the 8th and 10th number, so the numbers would the look like this: 123456-120340.. And i would like to every row in the column.
I'm not a "coder" by no means, but I did some fumbling around the internet and came up with this:
Sub Gridnumbers()
Application.ScreenUpdating = False
List = Selection.Rows.Count
For i = List To 1 Step -1
temp = ActiveCell
ActiveCell.Offset(1, 0).Select
x = Right(temp, 2)
y = concatenate("0", x, "0")
z = Mid(temp, 7, 2)
last = concatenate(z, y)
first = Left(temp, 6)
ActiveCell = concatenate(first, last)
ActiveCell.Offset(-i, 0).Select
Next i
Application.ScreenUpdating = True
End Sub
Needless to say, it doesn't work :-(