I have a created a sub to check a value of a column and clear contents of a particular range. But when selecting the value, I continuously get type mismatch error. I have tried the following four methods too. The sheet is refreshed from a sql server source and the datatype of it is string. I changed the data in the source to be a int but of now use. Any help will be highly appreciated.
Sub abc()
Dim var1 As String
**var1 = Sheets(Sheet1).Cells(1, "A").Value
var1 = Sheets(Sheet1).Cells(1, "A").Text
var1 = Sheets(Sheet1).Range("A1").Value
var1 = Sheets(Sheet1).Range("A1").Text**
End Sub