stephen.smith
Board Regular
- Joined
- Jul 7, 2010
- Messages
- 119
Hi Guys
I am trying to use VBA code to find and replace a column number in a cell reference from column A to Column B, however in the cell reference $A has been used. I have tried to perform this using the code below but it doesnt work.
Code:
Sub test()
On Error Resume Next
Dim c As String, d As String
c = InputBox("A")
d = InputBox("B")
Range("A1:A100").Replace "$" & c, "$" & d
End Sub
I have also attached a picture of an example of what the cells look like and one of the cells show the exact cell reference of one of the cells I am attempting to change.
Any help would be really appreciated as this is causing me a lot of problems.
Thanks in advance
Stephen
I am trying to use VBA code to find and replace a column number in a cell reference from column A to Column B, however in the cell reference $A has been used. I have tried to perform this using the code below but it doesnt work.
Code:
Sub test()
On Error Resume Next
Dim c As String, d As String
c = InputBox("A")
d = InputBox("B")
Range("A1:A100").Replace "$" & c, "$" & d
End Sub
I have also attached a picture of an example of what the cells look like and one of the cells show the exact cell reference of one of the cells I am attempting to change.
Any help would be really appreciated as this is causing me a lot of problems.
Thanks in advance
Stephen