Johnny Thunder
Well-known Member
- Joined
- Apr 9, 2010
- Messages
- 693
- Office Version
- 2016
- Platform
- MacOS
Hello all,
I am working on a project and hit a road block.
I have a spreadsheet that users will populate using various dropdown lists and such. Data begins on B17:M67, a user could even add in additional rows if needed using a macro.
My specific question is, if a user decided to enter data in the middle of the spreadhsheet instead of starting on the first row how would you code a Copy/Paste to not include the blank rows of data when pasting to another sheet?
I have a macro that copies the users data and converts it to a CSV file for an upload template and I can't have blanks in the file so I need a way to have the blanks skipped and all data starting from the top like if a user started populating from the first row B17.
Please let me know if I am explaining this clearly. Thanks for all the help in advance.
I am working on a project and hit a road block.
I have a spreadsheet that users will populate using various dropdown lists and such. Data begins on B17:M67, a user could even add in additional rows if needed using a macro.
My specific question is, if a user decided to enter data in the middle of the spreadhsheet instead of starting on the first row how would you code a Copy/Paste to not include the blank rows of data when pasting to another sheet?
I have a macro that copies the users data and converts it to a CSV file for an upload template and I can't have blanks in the file so I need a way to have the blanks skipped and all data starting from the top like if a user started populating from the first row B17.
Please let me know if I am explaining this clearly. Thanks for all the help in advance.
Code:
'First Copy License Fee Calculator
With ThisWorkbook.Sheets("License Fee Calculator")
.Range("B17:L17", .Cells(.Rows.Count, "B").End(xlUp)).Copy
End With
Sheets("CSV Export").Range("A2").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=True, Transpose:=False
Application.CutCopyMode = False
'Copy Qty, Subtotal & Grand Total - License Fee Calculator
With ThisWorkbook.Sheets("License Fee Calculator")
.Range("M17:O17", .Cells(.Rows.Count, "M").End(xlUp)).Copy
End With
Sheets("CSV Export").Range("M2").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=True, Transpose:=False
Application.CutCopyMode = False
'Copy Agreement Type - License Fee Calculator
With ThisWorkbook.Sheets("License Fee Calculator")
.Range("P17", .Cells(.Rows.Count, "P").End(xlUp)).Copy
End With
Sheets("CSV Export").Range("V2").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=True, Transpose:=False
Application.CutCopyMode = False