Tim Hanson
Member
Hello,
I am tiring to write a macro so that every cell in column B gets quote marks around entire string in the cell.
My code places B2 in every cell in column B
Thanks for any help
I am tiring to write a macro so that every cell in column B gets quote marks around entire string in the cell.
My code places B2 in every cell in column B
Thanks for any help
Code:
Sub AddQuotes()
Dim rng As range, cell As range
Dim LastRow As Long
With Sheets("sheet1")
LastRow = .range("A" & .Rows.Count).End(xlUp).Row
End With
Set rng = Sheets("Sheet1").range("B2:B" & LastRow)
For Each cell In rng
Worksheets("Sheet1").range("B2:B" & LastRow).Formula = "=" & Chr(34) & "B2" & Chr(34) & ""
Next
End Sub