Burrgogi
Active Member
- Joined
- Nov 3, 2005
- Messages
- 495
- Office Version
- 2010
- Platform
- Windows
I'm trying to solve an autofill problem. I've been manually typing in the following into cell D2 and then manually doing an autofill.
=SUBSTITUTE(D$1,"#",TRIM(RIGHT(SUBSTITUTE(A2,"/",REPT(" ",255)),255)))
How do I modify the VBA routine to continue autofill in col. D as long as there is something contained in Col. A? I'm just learning VBA so I know the code I put together is full of holes. Would appreciate some help.
=SUBSTITUTE(D$1,"#",TRIM(RIGHT(SUBSTITUTE(A2,"/",REPT(" ",255)),255)))
How do I modify the VBA routine to continue autofill in col. D as long as there is something contained in Col. A? I'm just learning VBA so I know the code I put together is full of holes. Would appreciate some help.
Code:
Sub Do_It()
With Range("D:D")
If Range ("A:A") <> 0
Then
.SpecialCells(xlCellTypeBlanks).FormulaR1C1 = "=SUBSTITUTE(R1C,""#"",TRIM(RIGHT(SUBSTITUTE(RC[-3],""/"",REPT("" "",255)),255)))"
.Value = .Value
End With
End Sub