Transpose Excel row data to a form

Seeone

New Member
Joined
Apr 5, 2011
Messages
3
Hello all,

I have a sheet with a lot of rows of data, representing certain products and would like to transpose this to a sheet / form to send to clients (kind of like an invoice).

I can build a basic macro to copy the relevant cells in each row to the template, but i would like to be able to have a checkbox at the start of each row of data, so that when i ran the macro it will generate a form for each of the rows / products i have selected. :confused:

Please can you help?

My Excel knowledge is of a resaonable standard (not too advanced) but VB is all pretty new to me.

Thanks!
 

Some videos you may like

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

GlennUK

Well-known Member
Joined
Jul 8, 2002
Messages
11,402
Instead of a checkbox at the start of each row, insert a new column and make the values TRUE or FALSE ( as to whether to include in the processing ). Then you could loop through the contents of that column and test the value and process accordingly, or even do Advanced Filter to copy the subset to another range and simply process all entries in that range.
 

Seeone

New Member
Joined
Apr 5, 2011
Messages
3
Thanks Glenn - this is a good bit of advice as i need to also be able to copy down the rows with the same formating - something which i think could be a problem using checkboxes.

Could you give me more guidance as to the code i would write if i used 'True' or 'False' as the designation for whether i wanted the macro to apply to a given row?

I'm very new to VB and am stumbling thru this process at present. It's a lot more luck than judgement at this stage!

Cheers,
Seeone
 

GlennUK

Well-known Member
Joined
Jul 8, 2002
Messages
11,402
Not knowing what you are wanting to do with each row, this is a general idea:
Code:
For Each c In Range("A2:A999")
   If c.Value="" Then Exit For
   If c.Value Then
       ' do whatever processing for the row
   End If
Next
 

Seeone

New Member
Joined
Apr 5, 2011
Messages
3
Thanks again Glenn.

I am trying to copy data from given row to a template i have set up on another tab.

Currently I can copy the data for the test row i set up, but want to be able to have multiple rows of data which can be used to populate a template (This may also require me to copy the template in line with the number of rows which are 'TRUE'?), depending in whether i have them designated as 'TRUE' in column A (A1, A2, A3, etc.).

The problem I am facing is i) how to make the code apply to any row (i.e. not just A2:A10) and ii) how to apply the macro to the rows which are 'TRUE'.

Hmmmm..... will keep on trying, but if you can give anymore guidance, that would be great.

Thanks,
Seeone.
 

Watch MrExcel Video

Forum statistics

Threads
1,108,634
Messages
5,523,996
Members
409,555
Latest member
TIPSAREA

This Week's Hot Topics

Top