Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 158
Default Macro to populate master spreadsheet from others based on headers

Hi all:

I'm developing a tool to amalgamate all of our program plans into one
worksheet of one workbook. I am trying to figure out how to copy the
data from one worksheet to another, matching column headers.

I can restrict the template so they cannot add/remove columns, but
staff are going to be listed in the header row and we may have more
added.

This is what I am starting with – I’m not sure how much of it will
work, or how it will work.

Sub GetColumn()

' declarations to capture currently selected column/row address
Dim iRow As Long
Dim iColumn As Long


' I need an object to hold the current column
Dim cColumn As Long
' cRow will be the last row of data in the worksheet; as each source
will likely be different, I need to make sure that it appends the data
to the master worksheet rather than replacing existing.
Dim cRow As Long

‘ aCell is intended to grab the active cell contents and use it for
the search criteria.
Dim aCell As ActiveCell

‘ this is where the active cell is captured
iRow = ActiveCell.Row
iColumn = ActiveCell.Column

‘ for the find by column header. I just can’t manage to wrap my head
around all this.
For cColumn = iColumn + 1 To 45
Sheets("Master2").Select
Cells.Find(What:=aCell, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows,
SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate


Range("A2") = iColumn
ActiveCell.SpecialCells(xlLastCell).Select
Range("A3") = iRow

End Sub

Thoughts? Questions?


Steven
Reply
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
Creating a master spreadsheet Bob Shelline Excel Discussion (Misc queries) 1 March 10th 08 10:05 PM
How do I link from a master spreadsheet? uofu Excel Discussion (Misc queries) 2 August 15th 07 08:51 PM
Populate a spreadsheet with multiple entries from a master jdall Excel Discussion (Misc queries) 1 April 6th 06 01:31 AM
Populate worksheets based on a master sheet brownsatan Excel Worksheet Functions 1 February 6th 06 10:34 PM
Create a master worksheet based on 2 different worksheets Kristina Excel Worksheet Functions 0 August 23rd 05 07:41 PM


All times are GMT +1. The time now is 03:04 AM.

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"