Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Merging selected fields from 4 worksheets to a Master Worksheet

Hi Experts ,

I had created 4 input screens (worksheet type i.e A, B,C,D) , which populate
different required information into 3 "database" - another excel worksheets,
all residing in the same workbook.

Fields In Worksheet A
CIF, Client NAME, Investment Amt, Reward Pts

Fields In Worksheet B
CIF, Client NAME, Referred Member, Total AUA, Reward Pts

Fields In Worksheet C
CIF, Client NAME, Total AUA, Reward Pts

Fields In Worksheet D
CIF, Client NAME, Redemption, Reward Pts

I would want to design a macro to combine selected fields from the 4
worksheets to compute the Total Reward Pts that the client has achieved.

i.e I only want to copy CIF, Client Name , Reward Pts from all the 4
worksheets

Any advise ?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Merging selected fields from 4 worksheets to a Master Worksheet

Here is some code I wrote

You need to put the word END at the botttom of Column a on the worksheet A - D

I asssumed
CIF in column A
Reward Points in column E

You can change the Const statements to agree with your worksheet layout


Sub abc()

Const CIF_StartCell = "A2"
Const REWARD_StartCell = "E2"
Const Master_CIF_StartCell = "A2"
Const Master_REWARD_StartCell = "B2"
Const MasterWorksheetName = "Master"
Const StartRow = 2


Summary_RowCount = StartRow 'Start putting data here

For Each MyWorksheet In ThisWorkbook.Worksheets
If StrComp("Master", MyWorksheet.Name) < 0 Then

SourceRowCount = StartRow

Do While
(StrComp(Worksheets(MyWorksheet.Name).Range(CIF_St artCell).Offset(rowOffset:=SourceRowCount - StartRow, columnOffset:=0), "END") < 0)


Worksheets(MyWorksheet.Name).Range(CIF_StartCell). Offset(rowOffset:=SourceRowCount - StartRow, columnOffset:=0).Copy _

Destination:=Worksheets(MasterWorksheetName).Range (Master_CIF_StartCell). _
Offset(rowOffset:=Summary_RowCount - StartRow, columnOffset:=0)


Worksheets(MyWorksheet.Name).Range(REWARD_StartCel l).Offset(rowOffset:=SourceRowCount - StartRow, columnOffset:=0).Copy _

Destination:=Worksheets(MasterWorksheetName).Range (Master_REWARD_StartCell). _
Offset(rowOffset:=Summary_RowCount - StartRow, columnOffset:=0)

Summary_RowCount = Summary_RowCount + 1
SourceRowCount = SourceRowCount + 1
Loop
End If

Next MyWorksheet


End Sub

"Soultek" wrote:

Hi Experts ,

I had created 4 input screens (worksheet type i.e A, B,C,D) , which populate
different required information into 3 "database" - another excel worksheets,
all residing in the same workbook.

Fields In Worksheet A
CIF, Client NAME, Investment Amt, Reward Pts

Fields In Worksheet B
CIF, Client NAME, Referred Member, Total AUA, Reward Pts

Fields In Worksheet C
CIF, Client NAME, Total AUA, Reward Pts

Fields In Worksheet D
CIF, Client NAME, Redemption, Reward Pts

I would want to design a macro to combine selected fields from the 4
worksheets to compute the Total Reward Pts that the client has achieved.

i.e I only want to copy CIF, Client Name , Reward Pts from all the 4
worksheets

Any advise ?

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
synchronize worksheets with master worksheet [email protected] Excel Worksheet Functions 2 May 16th 07 01:33 AM
Merging Worksheets - Fields Of Same Data In Different Location [email protected] Excel Discussion (Misc queries) 1 June 30th 06 04:26 PM
Master Worksheet populated by other Worksheets? Steve Lundwall Excel Worksheet Functions 0 March 3rd 06 01:38 PM
Master Worksheet reflecting sub-worksheets [email protected] New Users to Excel 10 February 25th 06 02:49 AM
Rollup worksheets into a master worksheet - automatically? Annabelle Excel Discussion (Misc queries) 0 October 18th 05 07:54 PM


All times are GMT +1. The time now is 08:54 AM.

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

About Us

"It's about Microsoft Excel"