victorcarreto
New Member
- Joined
- Jun 28, 2012
- Messages
- 7
Hello
I need help with my macro, to move columns in my worksheet, basically what I am trying to do is to move column H to Q, column G to P, column F to N, column E to K, column D to J, and column C to H.
Here is my macro, it edit's the content in the of the cells in the column A, C, D, E and F. but now I need to move the columns as I described before...
ANY IDEAS???
Regards
Victor./
I need help with my macro, to move columns in my worksheet, basically what I am trying to do is to move column H to Q, column G to P, column F to N, column E to K, column D to J, and column C to H.
Here is my macro, it edit's the content in the of the cells in the column A, C, D, E and F. but now I need to move the columns as I described before...
ANY IDEAS???
Regards
Victor./
Code:
[COLOR=#000000][FONT=Arial]Sub Clean_Data()
Dim LastRow As Long, MyRange As Range, RangeH As Range
Dim C As Range, LA As Long, LB As Long, LC As Long, LD As Long, LE As Long, LF As Long, LG As Long
LA = Cells(Cells.Rows.Count, "A").End(xlUp).Row
LB = Cells(Cells.Rows.Count, "B").End(xlUp).Row
LC = Cells(Cells.Rows.Count, "C").End(xlUp).Row
LD = Cells(Cells.Rows.Count, "D").End(xlUp).Row
LE = Cells(Cells.Rows.Count, "E").End(xlUp).Row
LF = Cells(Cells.Rows.Count, "F").End(xlUp).Row
LG = Cells(Cells.Rows.Count, "G").End(xlUp).Row
LH = Cells(Cells.Rows.Count, "H").End(xlUp).Row
LastRow = WorksheetFunction.Max(LA, LB, LC, LD, LE, LF, LG, LH)
Set MyRange = Range("A1:A" & LastRow)
For Each C In MyRange
'C.Value = Replace(UCase(Replace(C.Value, "-", "")), ".PAR", "")
'C.Value = Replace(UCase(Replace(C.Value, "-", "")), ".ASM", "")
'C.Value = Replace(UCase(Replace(C.Value, "-", "")), ".PSM", "")
'C.Offset(, 2) = Replace(UCase(C.Offset(, 2)), "KG", "")
'C.Offset(, 3) = Replace(UCase(C.Offset(, 3)), "MM", "")
'C.Offset(, 4) = Replace(UCase(C.Offset(, 4)), "MM", "")
'C.Offset(, 5) = Replace(UCase(C.Offset(, 5)), "MM", "")
Next
[/FONT][/COLOR]
[COLOR=#000000][FONT=Arial]
[/FONT][/COLOR]
[COLOR=#000000][FONT=Arial]End Sub[/FONT][/COLOR]