Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
maybe something like this
Sub test() Dim cell As Range Dim lastrow As Long lastrow = Range("a65000").End(xlUp).Row For Each cell In Range("A1:A" & lastrow) cell.Offset(0, 1).Value = Left(cell.Value, Len(cell.Value) - 2) Do While Len(cell.Offset(0, 1).Value) < 4 cell.Offset(0, 1).Value = "'0" & cell.Offset(0, 1).Value Loop cell.Offset(0, 2).Value = Right(cell.Value, 2) Next End Sub -- Gary "Geir Holmavatn" wrote in message ... Gary Keramidas skrev: Sub test() Dim cell As Range For Each cell In Range("a1:a50") cell.Offset(0, 2) = cell.Value & " " & cell.Offset(0, 1).Value Next End Sub Great If I have a column with integers: 12345 2345 345 .. and want to split the two last digits into one row and leftpad the first digits with zeros into another row like this: 12345 0123 45 2345 0023 45 345 0003 45 how can that be done in code..? /geir |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Loop through Columns | Excel Programming | |||
loop over columns | Excel Discussion (Misc queries) | |||
Loop through columns and then rows | Excel Programming | |||
loop through columns | Excel Programming | |||
Loop 20 columns Help! | Excel Programming |