Answer the question
In order to leave comments, you need to log in
How to change an Excel macro from "vertical" to "horizontal"?
There is a macro that selects columns 1 and 3, substituting quotes at the beginning and end of the selected cells.
Sub QQ()
For I = 1 To Cells(Rows.Count, 1).End(xlUp).Row
With Cells(I, 1)
If .Value <> "" And Left(.Value, 1) <> """" And Right(.Value, 1) <> """" Then .Value = """" & .Value & """"
End With
Next I
For I = 1 To Cells(Rows.Count, 1).End(xlUp).Row
With Cells(I, 3)
If .Value <> "" And Left(.Value, 1) <> """" And Right(.Value, 1) <> """" Then .Value = """" & .Value & """"
End With
Next I
End Sub
Answer the question
In order to leave comments, you need to log in
Sub QQQ()
For I = 1 To Cells(1, Columns.Count).End(xlToLeft).Column
With Cells(1, I)
If .Value <> "" And Left(.Value, 1) <> """" And Right(.Value, 1) <> """" Then .Value = """" & .Value & """"
End With
Next I
For I = 1 To Cells(3, Columns.Count).End(xlToLeft).Column
With Cells(3, I)
If .Value <> "" And Left(.Value, 1) <> """" And Right(.Value, 1) <> """" Then .Value = """" & .Value & """"
End With
Next I
End Sub
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question