jdautel
07-27-2016, 10:49 AM
Ok, I'm new to vba as of right now but learning to help people more efficient in my office. Currently we use quickbooks and when exporting financials to excel it returns something like this:
Income
Maintenance
Landscaping
Total Commerical
Landscaping
Landscaping
Customer Discount
Landscaping - Other
Residential
Total Landscaping
So I've created a vba code that literally hardcodes cut and pastes every single one of these cells and puts them into column a
For instance:
Sheets("New").Select
Range("B5:B21").Cut Range("A5:A21")
I done this for every single cell. This works for this specific worksheet but if I export another worksheet that has a different set up it won't accomplish the task correctly.
I'm trying to create a code where I can cut a cell based on certain criteria, and paste it into that same row number but in the A column. Offsetting won't seem to work because some of the text is in column b, some in c, and some in D. I was thinking I could create an if statement that has the following logic: If cell is in column B offset by (0,-1), if in column C offset by (0,-2), etc, etc.
Income
Maintenance
Landscaping
Total Commerical
Landscaping
Landscaping
Customer Discount
Landscaping - Other
Residential
Total Landscaping
So I've created a vba code that literally hardcodes cut and pastes every single one of these cells and puts them into column a
For instance:
Sheets("New").Select
Range("B5:B21").Cut Range("A5:A21")
I done this for every single cell. This works for this specific worksheet but if I export another worksheet that has a different set up it won't accomplish the task correctly.
I'm trying to create a code where I can cut a cell based on certain criteria, and paste it into that same row number but in the A column. Offsetting won't seem to work because some of the text is in column b, some in c, and some in D. I was thinking I could create an if statement that has the following logic: If cell is in column B offset by (0,-1), if in column C offset by (0,-2), etc, etc.