Good Day people,
I was practicing some VBA questions and had hit a roadblock in the coding.
The question was asking me to calculate distance between two points. My Goal was to clear the previously obtained value.
However, the whole excel sheet got cleared.
Here's the coding
If (Range("A2") <> "" and Range("B2" ="") then
Range("A2").clear
ElseIf (Range("A2") <> "" and range("B2" <> "") then
Selection.end(xlToRight).select: CNo=Activecell.column
Range("A2", cells(2, CNo)).clear
End If
Can Someone help me?
I was practicing some VBA questions and had hit a roadblock in the coding.
The question was asking me to calculate distance between two points. My Goal was to clear the previously obtained value.
However, the whole excel sheet got cleared.
Here's the coding
If (Range("A2") <> "" and Range("B2" ="") then
Range("A2").clear
ElseIf (Range("A2") <> "" and range("B2" <> "") then
Selection.end(xlToRight).select: CNo=Activecell.column
Range("A2", cells(2, CNo)).clear
End If
Can Someone help me?