What is the format for "ws.Range().Tex t"?
I try to use the list from A1:A3, but "ws.Range("A1:A 3").Text" won't work?
I try to use the list from A1:A3, but "ws.Range("A1:A 3").Text" won't work?
Sub Macro4()
Dim wsText As Worksheet, ws As Worksheet
Set wsText = Worksheets("TEXT")
Set ws = Worksheets("Sheet1")
Dim sFind As String, sReplace As String, v As Variant
Dim i As Integer, j As Integer, iRow As Integer
For i = 1 To wsText.Cells(1, 1).CurrentRegion.Columns.Count 'for each column
sFind = wsText.Cells(1, i).Text
sReplace = ""
For j = 1 To ws.Range("A1").End(xlToRight).Column
iRow = ws.Cells(1, j).Value
sReplace = sReplace & wsText.Cells(iRow, i).Text & Chr(10)
Next j
MsgBox "Replace " & sFind & " with " & sReplace
Next i
End Sub
Comment