IrishMist1748
Board Regular
- Joined
- Sep 27, 2010
- Messages
- 131
I have the following macro that builds a list of URLs in "column V" based upon a values in columns B through K and L through U. The problem is i am getting error: "Runtime error '13': Type mismatch referencing:
Cells(Rows.Count, DestCol).End(xlUp).Offset(1).Resize(lr).Value _
= Cells(1, myCols(c)).Resize(lr).Value
in the code below:
Any ideas on what might be wrong? Any help is GREATLY appreciated!
Cells(Rows.Count, DestCol).End(xlUp).Offset(1).Resize(lr).Value _
= Cells(1, myCols(c)).Resize(lr).Value
in the code below:
Code:
Sub Combine_Columns()
Dim myCols()
Dim c As Long, lr As Long
Dim DestCol As String
Application.ScreenUpdating = False
myCols = Array("L", "M", "N", "O", "P", "Q", "R", "S", "T", "U") '<-- Cols to combine
DestCol = "V" '<-- Destination column
For c = 0 To UBound(myCols)
lr = Cells(Rows.Count, myCols(c)).End(xlUp).Row
Cells(Rows.Count, DestCol).End(xlUp).Offset(1).Resize(lr).Value _
= Cells(1, myCols(c)).Resize(lr).Value
Next c
Cells(1, DestCol).Delete Shift:=xlUp
Application.ScreenUpdating = True
End Sub
Any ideas on what might be wrong? Any help is GREATLY appreciated!