O
owain
Hi!
I am currently writing a macro for Excel and I have hit a problem.
Here is my working Macro code.
Sub dialight()
Range("B1").Select
ActiveCell.Offset(1, 0).Select
Do While ActiveCell.Value > ""
If ActiveCell.Value = "DIALIGHT" Then
ActiveCell.Offset(0, -1).Select
ActiveCell.Value = ActiveCell.Value + "F"
ActiveCell.Offset(1, 1).Select
Else
ActiveCell.Offset(1, 0).Select
End If
Loop
End Sub
This works perfectly but the problem I have is if someone runs the
Macro twice, the ActiveCell.value will end of having 2 Fs at the end of
it which will cause huge problems further down the line.
How can I can check to see if the ActiveCell.Value already has an F at
the end of it?
Thanks,
Owain.
I am currently writing a macro for Excel and I have hit a problem.
Here is my working Macro code.
Sub dialight()
Range("B1").Select
ActiveCell.Offset(1, 0).Select
Do While ActiveCell.Value > ""
If ActiveCell.Value = "DIALIGHT" Then
ActiveCell.Offset(0, -1).Select
ActiveCell.Value = ActiveCell.Value + "F"
ActiveCell.Offset(1, 1).Select
Else
ActiveCell.Offset(1, 0).Select
End If
Loop
End Sub
This works perfectly but the problem I have is if someone runs the
Macro twice, the ActiveCell.value will end of having 2 Fs at the end of
it which will cause huge problems further down the line.
How can I can check to see if the ActiveCell.Value already has an F at
the end of it?
Thanks,
Owain.