I am trying to create a macro to copy only cell in 3 columns that have data. I have the macro working in one of the columns but if I try one to the left or all three in a range it doesn't select properly and am unable to proceed.
I use this and it works fine.
'Copy Cost Codes and Qty as Text Values'
Sheets("18001 Cap Sheet").Select
LR = Range("L" & Rows.Count).End(xlUp).Row
Range("L9:N" & LR).Copy
Range("V9:X" & LR).PasteSpecial xlPasteValues
Application.CutCopyMode = False
'Select Revenue Values and Move to Job Cost Contract Items Sheet'
Sheets("18001 Cap Sheet").Select
LR = Range("L" & Rows.Count).End(xlUp).Row
Range("x9:x" & LR).SpecialCells(xlCellTypeConstants, 23).Select
Selection.Copy
Sheets("Job Cost Contract Items").Select
Range("K5").Select
ActiveSheet.Paste
what I want to do is this:
'Copy Cost Codes and Qty as Text Values'
Sheets("18001 Cap Sheet").Select
LR = Range("L" & Rows.Count).End(xlUp).Row
Range("L9:N" & LR).Copy
Range("V9:X" & LR).PasteSpecial xlPasteValues
Application.CutCopyMode = False
'Select Revenue Values and Move to Job Cost Contract Items Sheet'
Sheets("18001 Cap Sheet").Select
LR = Range("L" & Rows.Count).End(xlUp).Row
Range("v9:x" & LR).SpecialCells(xlCellTypeConstants, 23).Select
Selection.Copy
Sheets("Job Cost Contract Items").Select
Range("i5").Select
ActiveSheet.Paste
when I change it to the range that includes all 3 columns it's selecting it funny and not just non contiguous cells in the first 2 columns.
Even if I just try v or w, then it's the same thing and selecting the entire range and not just cells that have data.
I use this and it works fine.
'Copy Cost Codes and Qty as Text Values'
Sheets("18001 Cap Sheet").Select
LR = Range("L" & Rows.Count).End(xlUp).Row
Range("L9:N" & LR).Copy
Range("V9:X" & LR).PasteSpecial xlPasteValues
Application.CutCopyMode = False
'Select Revenue Values and Move to Job Cost Contract Items Sheet'
Sheets("18001 Cap Sheet").Select
LR = Range("L" & Rows.Count).End(xlUp).Row
Range("x9:x" & LR).SpecialCells(xlCellTypeConstants, 23).Select
Selection.Copy
Sheets("Job Cost Contract Items").Select
Range("K5").Select
ActiveSheet.Paste
what I want to do is this:
'Copy Cost Codes and Qty as Text Values'
Sheets("18001 Cap Sheet").Select
LR = Range("L" & Rows.Count).End(xlUp).Row
Range("L9:N" & LR).Copy
Range("V9:X" & LR).PasteSpecial xlPasteValues
Application.CutCopyMode = False
'Select Revenue Values and Move to Job Cost Contract Items Sheet'
Sheets("18001 Cap Sheet").Select
LR = Range("L" & Rows.Count).End(xlUp).Row
Range("v9:x" & LR).SpecialCells(xlCellTypeConstants, 23).Select
Selection.Copy
Sheets("Job Cost Contract Items").Select
Range("i5").Select
ActiveSheet.Paste
when I change it to the range that includes all 3 columns it's selecting it funny and not just non contiguous cells in the first 2 columns.
Even if I just try v or w, then it's the same thing and selecting the entire range and not just cells that have data.