ChrisLatham
Board Regular
- Joined
- Jan 13, 2009
- Messages
- 59
Below is a segment of code from a Macro I have created, it's a bit rough etc but that may or may not be the problem.
When this code runs, the first cell of each column which I concatenate seems to end up getting deleted. I've pasted part of it below, can anyone point out what could be causing my problem?
Thanks in advance:
When this code runs, the first cell of each column which I concatenate seems to end up getting deleted. I've pasted part of it below, can anyone point out what could be causing my problem?
Thanks in advance:
Code:
'// Begin Sheet2 Process
Sheets("Sheet2").Activate
Range("A3").Select
Range("A3:AU156").Sort Key1:=Range("Q5"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Columns("A:B").Select
Selection.Delete Shift:=xlToLeft
Columns("D:D").Select
Selection.Insert Shift:=xlToRight
Columns("D:D").Select
Selection.Insert Shift:=xlToRight
Range("D3").Select
ActiveCell.FormulaR1C1 = _
"=CONCATENATE(RC[2]&"", ""&RC[3]&"", ""&RC[4]&"", ""&RC[5])"
Range("D3").Select
Selection.AutoFill Destination:=Range("D3:D10000"), Type:=xlFillDefault
Range("D3:D10000").Select
Columns("D:D").Select
Selection.Copy
Columns("E:E").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Columns("D:D").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlToLeft
Columns("E:H").Select
Selection.Delete Shift:=xlToLeft
Columns("D:D").EntireColumn.AutoFit
Range("D1").Select
Cells.Select