LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default probably a relatively easy macro question....

Hi,
I'm totally new to macros in Excel and I'm hoping there's an easy
solution to my problem. Any help is much appreciated....

Here's my problem:

I have a workbook.
*Each sheet in the workbook is a day in a tour itinerary, formatted in
such a way that it'll look pretty when printed out.
*Each sheet is layed out in the same way, eg. Cell D4 is the venue
name, Cell F5 is the street address, etc.
*The number of sheets may change from tour to tour

I want to end up with a CSV file in which each line is the relevant
data from each sheet. My plan was to do the following:

*create 2 new sheets at the end of the workbook (I can do this bit).
Let's say they're sheet25 and sheet26
*on the first row of the first new sheet type the CSV headers across
the top (so A1 = "venue_name", A2="venue_phone", A3="venue_postcode",
etc)
*on the row beneath enter the relevant reference cell for the data I
need (so if the venue name appears in cell D4 on each sheet then cell
B2 will say "D4")

I want the macro to act on the second new sheet and do the following:
* figure out how many columns contain information (or I could just
write this value in another cell which the macro refers to)
*for all cells in row A which contain information - set sheet26.Ax
equal to sheet25.Ax (i.e. copy the first header row)

*then something like....

for ($i=0 ; $i<FinalSheet ; $i++){
for ($j=0 ; $j<FinalHeaderCol ; $j++){
Cell(row=A+$i , col=$j) = Sheet($i).Cell(ref = sheet25.B$j) //
so using the value written under the header row as a reference for the
cell to take the value from

}
}



I wish I could explain it better. I'm sure it's not a difficult task,
my problem is knowing the right syntax to use and how to take a value
from a Cell and use that as a reference for the lookup of another
cell.


Thanks for your help,

Joe
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro fill down question, I think its easy Still Learning Excel Programming 5 August 21st 06 07:11 PM
Easy question: Have macro ignore #N/A Paul987[_19_] Excel Programming 2 March 27th 06 09:27 PM
new user with easy question? not easy for me speakeztruth New Users to Excel 5 June 3rd 05 09:40 PM
An easy macro question and one I believe to be a little more diffi TroutKing Excel Worksheet Functions 3 January 18th 05 09:17 PM
Easy question: macro to move cursor one to the right Sean Sydor Excel Programming 2 August 24th 03 04:26 AM


All times are GMT +1. The time now is 11:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"