Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I was going to export my data to FileMaker to try to do this with series of IF statements and Concatenations, but for efficiency I' really like to use a VBA macro. Current data set, Sheet1: A (title)/B (page start)/C (page end)/D (answer key) cats/1/2/answers dogs/3/3/ bears/4/6/answers frogs/7/7/answers I want to combine the contents of an entire row into one cell. Ideally after running a macro, the above data would like this on Sheet2: 1 cats, pp. 1-2, answer key 2 cats, pp. 1-2 3 dogs, p. 3 4 bears, pp. 4-6, answer key 5 bears, pp. 4-6 6 frogs, p. 7, answer key 7 frogs, p. 7 Explanation: If a title has an answer key (i.e., if column D is *not* blank), the it gets listed twice, the first listing should have with the word "answer key", and the second listing should not (see rows 1 and above). If the page range is greater than one page (i.e., if 'page start' doe *not* equal 'page end'), then format pages like this: "pp. 3-4"; but if the page range is only one page (i.e., 'page start' = 'pag end'), then format pages this way: "p. 5". Can anyone help me with a macro? Thank you -- marle ----------------------------------------------------------------------- marlea's Profile: http://www.excelforum.com/member.php...fo&userid=2620 View this thread: http://www.excelforum.com/showthread.php?threadid=46715 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to combine data based on two fields.. | Excel Discussion (Misc queries) | |||
inserting a number from a particular cell based on if/thens | Excel Discussion (Misc queries) | |||
combine 2 tables of data into one based on date | Excel Worksheet Functions | |||
Have "IF,Then" to get data from multiple columns--can I nest add'l IF,THENs? | Excel Worksheet Functions | |||
Macro to combine data in a column | Excel Programming |