Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Help with the Macro.

Hi,
I have Four work Books. Three are contain the data and one is to link
those datas from those three work books. Examples.

WorkBook #1. In cell A1 has customer name
A2 has total amount.

WorkBook #2. In cell A1 has customer name
A2 has total amount.

WorkBook #3. In cell A1 has customer name
A2 has total amount.

WorkBook # 4 will link those workbook #1,2,3's Customer name and the total
amount.

But, if some of the workbook doesn't have the customer name and amount. I
don't want it to show on the workbook #4 and not even the empty space. How do
I write the code for this.

Any help would be very appreciated.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Help with the Macro.

Pull ALL the data from the first 3 book onto a sheet in the final book (name
the sheet xxx_Data). Remove any blank lines and create a pivot table from
the data. It won't ever display blank lines if you don't want it to.

"sighsky" wrote:

Hi,
I have Four work Books. Three are contain the data and one is to link
those datas from those three work books. Examples.

WorkBook #1. In cell A1 has customer name
A2 has total amount.

WorkBook #2. In cell A1 has customer name
A2 has total amount.

WorkBook #3. In cell A1 has customer name
A2 has total amount.

WorkBook # 4 will link those workbook #1,2,3's Customer name and the total
amount.

But, if some of the workbook doesn't have the customer name and amount. I
don't want it to show on the workbook #4 and not even the empty space. How do
I write the code for this.

Any help would be very appreciated.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help with the Macro.


What do you want done with the total amount from each sheet?
Do you want the sum of the total amount from sheets 1 - 3 on sheet 4?
Or do you want the total amount from each sheet shown on sheet 4

--
bhofset
-----------------------------------------------------------------------
bhofsetz's Profile: http://www.excelforum.com/member.php...fo&userid=1880
View this thread: http://www.excelforum.com/showthread.php?threadid=37902

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Help with the Macro.

I want the total amount from each sheet show on sheet 4.


"bhofsetz" wrote:


What do you want done with the total amount from each sheet?
Do you want the sum of the total amount from sheets 1 - 3 on sheet 4?
Or do you want the total amount from each sheet shown on sheet 4?


--
bhofsetz
------------------------------------------------------------------------
bhofsetz's Profile: http://www.excelforum.com/member.php...o&userid=18807
View this thread: http://www.excelforum.com/showthread...hreadid=379029


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help with the Macro.


This isn't pretty but it works (with my limited testing)

Give it a try.


Code:
--------------------
Sub ConsolCust()
Dim S1Rows As Long, x As Long, y As Long
Dim Cust As String, S2Value As Single, S3Value As Single
y = 1
Worksheets(1).Activate
S1Rows = ActiveSheet.UsedRange.Rows.Count
For x = 1 To S1Rows
Cust = Worksheets(1).Range("A" & x)
Sheets("Sheet2").Select
On Error Resume Next
Cells.Find(What:=Cust, LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False).Activate
If Err.Number = 91 Then GoTo NotFound
S2Value = ActiveCell.Offset(0, 1)
Sheets("Sheet3").Select
On Error Resume Next
Cells.Find(What:=Cust, LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False).Activate
If Err.Number = 91 Then GoTo NotFound
S3Value = ActiveCell.Offset(0, 1)
With Sheets(4)
.Cells(y, 1) = Cust
.Cells(y, 2) = Sheets(1).Cells(x, 2)
.Cells(y, 3) = S2Value
.Cells(y, 4) = S3Value
End With
y = y + 1
NotFound:
Next x
End Sub
--------------------


Perhaps someone else may have a more elegant solution to your problem.


--
bhofsetz
------------------------------------------------------------------------
bhofsetz's Profile: http://www.excelforum.com/member.php...o&userid=18807
View this thread: http://www.excelforum.com/showthread...hreadid=379029

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
Macro recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
how to count/sum by function/macro to get the number of record to do copy/paste in macro tango Excel Programming 1 October 15th 04 01:16 PM
macro to delete entire rows when column A is blank ...a quick macro vikram Excel Programming 4 May 3rd 04 08:45 PM
Start Macro / Stop Macro / Restart Macro Pete[_13_] Excel Programming 2 November 21st 03 05:04 PM


All times are GMT +1. The time now is 08:33 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"