View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Combining Multiple Workbooks

It is easier to delete the empty rows after you merge the data.
Can you check one column for empty cells ?


there a way to have this macro automatically run when the one
spreadsheet is opened? That way anyone can do it?


You can run the macro in the open event of the workbook
Copy this in the Thisworkbook module of the workbook

Private Sub Workbook_Open()
Call Basic_Example_1
End Sub

See
http://www.cpearson.com/excel/events.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


wrote in message ups.com...
WOW!! Yeah!! This worked!! I'm thrilled :) SOOOO excited!!

Two LAST teeny, tiny things... because MOST of the rows will likely be
blank... is there some way to have it filter out the empty ones so
that it doesn't put it into the spreadsheet? If not, it's not a HUGE
deal - but... it'd definitely make it cleaner looking!!! Also... is
there a way to have this macro automatically run when the one
spreadsheet is opened? That way anyone can do it?

THANK YOU!!! Even for someone as incapable of VB - you made this
simple enough!!

THANKS!!!! :)

On Jul 26, 2:38 pm, rdwj wrote:
Yolande,
Indeed, as perhttp://www.rondebruin.nl/copy3.htm, but I guess you want to
hear a little bit more.
In the above reference, find the subroutine that starts with Sub
Basic_Example_1() which contains the full routine.
Copy the full routine to a VB workbook :
- open a new workbook
- <Alt<F11 to go the visual basic editor
- "Insert", "Module"
and copy the while subroutine in this module (ie up to and including the
first "End Sub"

Things you need to change:
1) MyPath = "C:\Users\Ron\test"
change the "C:\Users\Ron\test" to the directory where all workbooks are
stored.
2) With mybook.Worksheets(1)
Set sourceRange = .Range("A1:C1")
End With
change to
With mybook.Worksheets(1)
Set sourceRange = .Range("F7:I49")
End With

Now close the VB editor and save the workbook (the way the code works is
that it opens a new workbook and copies all the ranges F7 to I49 underneath
eachother in the new workbook).
Run the code through "Tools" "Macro's" "Macro" and select "Basic_Example_1"
and run....
Good luck

rdwj



" wrote:
I'm hoping I can get some assistance... I'm truly not familiar with
much VB (almost none) and I'm trying to get excel to do something
that, based on what I'm reading, is possible... I just need some
assistance.


I'm trying to combine a lot of one sheet workbooks into one master
workbook. I've found this reference to help:


http://www.rondebruin.nl/copy3.htm


But, I can't seem to make it work (because I don't understand VB
enough to know if I'm entering the stuff correctly?)


To try and simplify... what I'm trying to do is this:


I've created a tracker for about 300 employees to keep record of phone
calls that are received. The columns that matter for data a


Account Number / Disposition / Reason / Other Reason


These are the only things the agents will be entering that matters...
of these 4 boxes... 2 are drop down boxes with prefilled information.
The information they will be entering will begin in row 7... columns
F, G, H and I. The tracker only has rows for data up to row 49 - same
columns. (Not all rows would be filled - most likely only about 20
rows or so but I provided extra, just in case).


Each rep will receive a blank tracker to save - which can be saved
into one folder so they're all together in the same location - but,
they'll still be a bunch of indivdual files. What I need to do is
have one database that houses all the information that people collect
- so that I will be able to determine how many calls were received
and, of those calls, how many were each "reason" code. The auto-
filtering I can figure out... but, can someone help me with figuring
out how to make these workbooks all compile into one with the range
that I need?


Oh - if you're going to just put the code - can you tell me where it
is that I need to "title" the page or whatever - because I'll end up
just copying it exactly as you have it - so that's where I get messed
up. I don't know what is supposed to be what I call it and what
should be left alone. If you tell me what I should title the pages,
I'll gladly do that!!


Thanks for any assistance!!!! :)- Hide quoted text -


- Show quoted text -