Hello,
I am moving data with VBA from 1 sheet to another and for the most part it works great. All the data is moved and is where i need it to be. The problem with one of the columns is that somehow the format is changed and the change causes my other reference to break. Below is the VBA i am using.
the problem is that the last part of the script for moving G2:G to M2:M i need the data to read this way[TABLE="width: 64"]
<tbody>[TR]
[TD="class: xl65, width: 64"]+5 Highly satisfied[/TD]
[/TR]
[TR]
[TD="class: xl65"]+3[/TD]
[/TR]
[TR]
[TD="class: xl65"]+5 Highly satisfied[/TD]
[/TR]
[TR]
[TD="class: xl65"]+5 Highly satisfied[/TD]
[/TR]
[TR]
[TD="class: xl65"]+4[/TD]
[/TR]
</tbody>[/TABLE]
but instead the data is changed to read this way
[TABLE="width: 64"]
<tbody>[TR]
[TD="class: xl65, width: 64"]+5 Highly satisfied[/TD]
[/TR]
[TR]
[TD="class: xl65"] 3[/TD]
[/TR]
[TR]
[TD="class: xl65"]+5 Highly satisfied[/TD]
[/TR]
[TR]
[TD="class: xl65"]+5 Highly satisfied[/TD]
[/TR]
[TR]
[TD="class: xl65"] 4[/TD]
[/TR]
</tbody>[/TABLE]
and breaks my reference =ABS(MID(F2,2,1)) on my output table.
Thanks for the help! and if i did not explain well enough i can put something in a drop
I am moving data with VBA from 1 sheet to another and for the most part it works great. All the data is moved and is where i need it to be. The problem with one of the columns is that somehow the format is changed and the change causes my other reference to break. Below is the VBA i am using.
Code:
Sub MoveData()
Dim lastRow As Long
'DATALINK
lastRow = Sheets("Raw Data").Range("A" & Rows.Count).End(xlUp).Row
Sheets("DATA").Range("A2:A" & lastRow).Value = Sheets("Raw Data").Range("A2:A" & lastRow).Value
'AGENT
lastRow = Sheets("Raw Data").Range("B" & Rows.Count).End(xlUp).Row
Sheets("DATA").Range("B2:B" & lastRow).Value = Sheets("Raw Data").Range("B2:B" & lastRow).Value
'DIRECTOR
lastRow = Sheets("Raw Data").Range("E" & Rows.Count).End(xlUp).Row
Sheets("DATA").Range("C2:C" & lastRow).Value = Sheets("Raw Data").Range("E2:E" & lastRow).Value
'CENTER
lastRow = Sheets("Raw Data").Range("F" & Rows.Count).End(xlUp).Row
Sheets("DATA").Range("D2:D" & lastRow).Value = Sheets("Raw Data").Range("F2:F" & lastRow).Value
'SURVEY
lastRow = Sheets("Raw Data").Range("G" & Rows.Count).End(xlUp).Row
Sheets("DATA").Range("E2:E" & lastRow).Value = Sheets("Raw Data").Range("G2:G" & lastRow).Value
'REP SAT
lastRow = Sheets("Raw Data").Range("H" & Rows.Count).End(xlUp).Row
Sheets("DATA").Range("F2:F" & lastRow).Value = Sheets("Raw Data").Range("M2:M" & lastRow).Value
End Sub
the problem is that the last part of the script for moving G2:G to M2:M i need the data to read this way[TABLE="width: 64"]
<tbody>[TR]
[TD="class: xl65, width: 64"]+5 Highly satisfied[/TD]
[/TR]
[TR]
[TD="class: xl65"]+3[/TD]
[/TR]
[TR]
[TD="class: xl65"]+5 Highly satisfied[/TD]
[/TR]
[TR]
[TD="class: xl65"]+5 Highly satisfied[/TD]
[/TR]
[TR]
[TD="class: xl65"]+4[/TD]
[/TR]
</tbody>[/TABLE]
but instead the data is changed to read this way
[TABLE="width: 64"]
<tbody>[TR]
[TD="class: xl65, width: 64"]+5 Highly satisfied[/TD]
[/TR]
[TR]
[TD="class: xl65"] 3[/TD]
[/TR]
[TR]
[TD="class: xl65"]+5 Highly satisfied[/TD]
[/TR]
[TR]
[TD="class: xl65"]+5 Highly satisfied[/TD]
[/TR]
[TR]
[TD="class: xl65"] 4[/TD]
[/TR]
</tbody>[/TABLE]
and breaks my reference =ABS(MID(F2,2,1)) on my output table.
Thanks for the help! and if i did not explain well enough i can put something in a drop