PC Review


Reply
Thread Tools Rate Thread

Combining Data from Multiple Worksheets into 1

 
 
Mike Lewis
Guest
Posts: n/a
 
      20th Jun 2008
Hello, I need some help. I have a survey that has one spreadsheet for each
customer. I also have a master excel spreadsheet that these need to roll up
to. Does anyone have suggestions of how I can roll up just the data from
these spreadsheets to the master spreadsheet. I am not sure that I want all
the spreadsheets to actually roll into the master spreadsheet or just the
data. I would love to be able to do this with a macro as this will be a
frequent survey.

Thanks in advance for your help.
 
Reply With Quote
 
 
 
 
Ron de Bruin
Guest
Posts: n/a
 
      20th Jun 2008
Start here
http://www.rondebruin.nl/copy3.htm

Try the add-in



--

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


"Mike Lewis" <(E-Mail Removed)> wrote in message news:E7F348DE-6D15-4D7F-87CC-(E-Mail Removed)...
> Hello, I need some help. I have a survey that has one spreadsheet for each
> customer. I also have a master excel spreadsheet that these need to roll up
> to. Does anyone have suggestions of how I can roll up just the data from
> these spreadsheets to the master spreadsheet. I am not sure that I want all
> the spreadsheets to actually roll into the master spreadsheet or just the
> data. I would love to be able to do this with a macro as this will be a
> frequent survey.
>
> Thanks in advance for your help.

 
Reply With Quote
 
Mike Lewis
Guest
Posts: n/a
 
      20th Jun 2008
Hello,

I tried cutting and pasting, and I get an error that takes me back to the
top with yellow. Here is what I cut and paste. Sub RDB_Merge_Data() turned
yellow and Get_File_Names highlighted blue.

Thoughts?

Sub RDB_Merge_Data()
Dim myFiles As Variant
Dim myCountOfFiles As Long

myCountOfFiles = Get_File_Names( _
MyPath:="C:\Documents and
Settings\lewism11\Desktop\Survey Subfile", _
Subfolders:=False, _
ExtStr:="*.xls", _
myReturnedFiles:=myFiles)

If myCountOfFiles = 0 Then
MsgBox "No files that match the ExtStr in this folder"
Exit Sub
End If

Get_Data _
FileNameInA:=True, _
PasteAsValues:=True, _
SourceShName:="", _
SourceShIndex:=1, _
SourceRng:="A1:G1", _
StartCell:="", _
myReturnedFiles:=myFiles

End Sub

"Ron de Bruin" wrote:

> Start here
> http://www.rondebruin.nl/copy3.htm
>
> Try the add-in
>
>
>
> --
>
> Regards Ron de Bruin
> http://www.rondebruin.nl/tips.htm
>
>
> "Mike Lewis" <(E-Mail Removed)> wrote in message news:E7F348DE-6D15-4D7F-87CC-(E-Mail Removed)...
> > Hello, I need some help. I have a survey that has one spreadsheet for each
> > customer. I also have a master excel spreadsheet that these need to roll up
> > to. Does anyone have suggestions of how I can roll up just the data from
> > these spreadsheets to the master spreadsheet. I am not sure that I want all
> > the spreadsheets to actually roll into the master spreadsheet or just the
> > data. I would love to be able to do this with a macro as this will be a
> > frequent survey.
> >
> > Thanks in advance for your help.

>

 
Reply With Quote
 
Ron de Bruin
Guest
Posts: n/a
 
      20th Jun 2008
Download the example workbook



--

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


"Mike Lewis" <(E-Mail Removed)> wrote in message news:0A7E4186-A61B-4DBB-B00B-(E-Mail Removed)...
> Hello,
>
> I tried cutting and pasting, and I get an error that takes me back to the
> top with yellow. Here is what I cut and paste. Sub RDB_Merge_Data() turned
> yellow and Get_File_Names highlighted blue.
>
> Thoughts?
>
> Sub RDB_Merge_Data()
> Dim myFiles As Variant
> Dim myCountOfFiles As Long
>
> myCountOfFiles = Get_File_Names( _
> MyPath:="C:\Documents and
> Settings\lewism11\Desktop\Survey Subfile", _
> Subfolders:=False, _
> ExtStr:="*.xls", _
> myReturnedFiles:=myFiles)
>
> If myCountOfFiles = 0 Then
> MsgBox "No files that match the ExtStr in this folder"
> Exit Sub
> End If
>
> Get_Data _
> FileNameInA:=True, _
> PasteAsValues:=True, _
> SourceShName:="", _
> SourceShIndex:=1, _
> SourceRng:="A1:G1", _
> StartCell:="", _
> myReturnedFiles:=myFiles
>
> End Sub
>
> "Ron de Bruin" wrote:
>
>> Start here
>> http://www.rondebruin.nl/copy3.htm
>>
>> Try the add-in
>>
>>
>>
>> --
>>
>> Regards Ron de Bruin
>> http://www.rondebruin.nl/tips.htm
>>
>>
>> "Mike Lewis" <(E-Mail Removed)> wrote in message news:E7F348DE-6D15-4D7F-87CC-(E-Mail Removed)...
>> > Hello, I need some help. I have a survey that has one spreadsheet for each
>> > customer. I also have a master excel spreadsheet that these need to roll up
>> > to. Does anyone have suggestions of how I can roll up just the data from
>> > these spreadsheets to the master spreadsheet. I am not sure that I want all
>> > the spreadsheets to actually roll into the master spreadsheet or just the
>> > data. I would love to be able to do this with a macro as this will be a
>> > frequent survey.
>> >
>> > Thanks in advance for your help.

>>

 
Reply With Quote
 
Mike Lewis
Guest
Posts: n/a
 
      20th Jun 2008
If I use the add-in and want to sell the template then what? Does the add in
follow the template if someone else uses it?

"Ron de Bruin" wrote:

> Start here
> http://www.rondebruin.nl/copy3.htm
>
> Try the add-in
>
>
>
> --
>
> Regards Ron de Bruin
> http://www.rondebruin.nl/tips.htm
>
>
> "Mike Lewis" <(E-Mail Removed)> wrote in message news:E7F348DE-6D15-4D7F-87CC-(E-Mail Removed)...
> > Hello, I need some help. I have a survey that has one spreadsheet for each
> > customer. I also have a master excel spreadsheet that these need to roll up
> > to. Does anyone have suggestions of how I can roll up just the data from
> > these spreadsheets to the master spreadsheet. I am not sure that I want all
> > the spreadsheets to actually roll into the master spreadsheet or just the
> > data. I would love to be able to do this with a macro as this will be a
> > frequent survey.
> >
> > Thanks in advance for your help.

>

 
Reply With Quote
 
Mike Lewis
Guest
Posts: n/a
 
      20th Jun 2008
Got it.....Now, one last question. The section below....

'Add a new workbook with one sheet
Set BaseWks = Workbooks.Add(xlWBATWorksheet).Worksheets(1)
Cnum = 1

Can you add the sheet to an existing workbook instead of a new workbook?
"Ron de Bruin" wrote:

> Download the example workbook
>
>
>
> --
>
> Regards Ron de Bruin
> http://www.rondebruin.nl/tips.htm
>
>
> "Mike Lewis" <(E-Mail Removed)> wrote in message news:0A7E4186-A61B-4DBB-B00B-(E-Mail Removed)...
> > Hello,
> >
> > I tried cutting and pasting, and I get an error that takes me back to the
> > top with yellow. Here is what I cut and paste. Sub RDB_Merge_Data() turned
> > yellow and Get_File_Names highlighted blue.
> >
> > Thoughts?
> >
> > Sub RDB_Merge_Data()
> > Dim myFiles As Variant
> > Dim myCountOfFiles As Long
> >
> > myCountOfFiles = Get_File_Names( _
> > MyPath:="C:\Documents and
> > Settings\lewism11\Desktop\Survey Subfile", _
> > Subfolders:=False, _
> > ExtStr:="*.xls", _
> > myReturnedFiles:=myFiles)
> >
> > If myCountOfFiles = 0 Then
> > MsgBox "No files that match the ExtStr in this folder"
> > Exit Sub
> > End If
> >
> > Get_Data _
> > FileNameInA:=True, _
> > PasteAsValues:=True, _
> > SourceShName:="", _
> > SourceShIndex:=1, _
> > SourceRng:="A1:G1", _
> > StartCell:="", _
> > myReturnedFiles:=myFiles
> >
> > End Sub
> >
> > "Ron de Bruin" wrote:
> >
> >> Start here
> >> http://www.rondebruin.nl/copy3.htm
> >>
> >> Try the add-in
> >>
> >>
> >>
> >> --
> >>
> >> Regards Ron de Bruin
> >> http://www.rondebruin.nl/tips.htm
> >>
> >>
> >> "Mike Lewis" <(E-Mail Removed)> wrote in message news:E7F348DE-6D15-4D7F-87CC-(E-Mail Removed)...
> >> > Hello, I need some help. I have a survey that has one spreadsheet for each
> >> > customer. I also have a master excel spreadsheet that these need to roll up
> >> > to. Does anyone have suggestions of how I can roll up just the data from
> >> > these spreadsheets to the master spreadsheet. I am not sure that I want all
> >> > the spreadsheets to actually roll into the master spreadsheet or just the
> >> > data. I would love to be able to do this with a macro as this will be a
> >> > frequent survey.
> >> >
> >> > Thanks in advance for your help.
> >>

>

 
Reply With Quote
 
Ron de Bruin
Guest
Posts: n/a
 
      20th Jun 2008
> Can you add the sheet to an existing workbook instead of a new workbook?

Yes

Set BaseWks = Thisworkbook.Worksheets("Yourworksheet")


--

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


"Mike Lewis" <(E-Mail Removed)> wrote in message news:03C4E9FA-EAE2-4255-A4B8-(E-Mail Removed)...
> Got it.....Now, one last question. The section below....
>
> 'Add a new workbook with one sheet
> Set BaseWks = Workbooks.Add(xlWBATWorksheet).Worksheets(1)
> Cnum = 1
>
> Can you add the sheet to an existing workbook instead of a new workbook?
> "Ron de Bruin" wrote:
>
>> Download the example workbook
>>
>>
>>
>> --
>>
>> Regards Ron de Bruin
>> http://www.rondebruin.nl/tips.htm
>>
>>
>> "Mike Lewis" <(E-Mail Removed)> wrote in message news:0A7E4186-A61B-4DBB-B00B-(E-Mail Removed)...
>> > Hello,
>> >
>> > I tried cutting and pasting, and I get an error that takes me back to the
>> > top with yellow. Here is what I cut and paste. Sub RDB_Merge_Data() turned
>> > yellow and Get_File_Names highlighted blue.
>> >
>> > Thoughts?
>> >
>> > Sub RDB_Merge_Data()
>> > Dim myFiles As Variant
>> > Dim myCountOfFiles As Long
>> >
>> > myCountOfFiles = Get_File_Names( _
>> > MyPath:="C:\Documents and
>> > Settings\lewism11\Desktop\Survey Subfile", _
>> > Subfolders:=False, _
>> > ExtStr:="*.xls", _
>> > myReturnedFiles:=myFiles)
>> >
>> > If myCountOfFiles = 0 Then
>> > MsgBox "No files that match the ExtStr in this folder"
>> > Exit Sub
>> > End If
>> >
>> > Get_Data _
>> > FileNameInA:=True, _
>> > PasteAsValues:=True, _
>> > SourceShName:="", _
>> > SourceShIndex:=1, _
>> > SourceRng:="A1:G1", _
>> > StartCell:="", _
>> > myReturnedFiles:=myFiles
>> >
>> > End Sub
>> >
>> > "Ron de Bruin" wrote:
>> >
>> >> Start here
>> >> http://www.rondebruin.nl/copy3.htm
>> >>
>> >> Try the add-in
>> >>
>> >>
>> >>
>> >> --
>> >>
>> >> Regards Ron de Bruin
>> >> http://www.rondebruin.nl/tips.htm
>> >>
>> >>
>> >> "Mike Lewis" <(E-Mail Removed)> wrote in message news:E7F348DE-6D15-4D7F-87CC-(E-Mail Removed)...
>> >> > Hello, I need some help. I have a survey that has one spreadsheet for each
>> >> > customer. I also have a master excel spreadsheet that these need to roll up
>> >> > to. Does anyone have suggestions of how I can roll up just the data from
>> >> > these spreadsheets to the master spreadsheet. I am not sure that I want all
>> >> > the spreadsheets to actually roll into the master spreadsheet or just the
>> >> > data. I would love to be able to do this with a macro as this will be a
>> >> > frequent survey.
>> >> >
>> >> > Thanks in advance for your help.
>> >>

>>


 
Reply With Quote
 
Mike Lewis
Guest
Posts: n/a
 
      21st Jun 2008
Ron de Bruin,

Ok, since you seem to be a wealth of knowledge, I would like to find out
something else from you. If I am giving this spreadsheet to another person,
how can I make it where they will not need to go into the macro and change
the "my Path" section. Can this be done from the spreadsheet itself,
meaning, can there be a place put on the spreadsheet that would ask them to
put in their path or something easier so that macro access is not needed?

Thanks so much for your help...You have helped me tremendously.

"Ron de Bruin" wrote:

> > Can you add the sheet to an existing workbook instead of a new workbook?

>
> Yes
>
> Set BaseWks = Thisworkbook.Worksheets("Yourworksheet")
>
>
> --
>
> Regards Ron de Bruin
> http://www.rondebruin.nl/tips.htm
>
>
> "Mike Lewis" <(E-Mail Removed)> wrote in message news:03C4E9FA-EAE2-4255-A4B8-(E-Mail Removed)...
> > Got it.....Now, one last question. The section below....
> >
> > 'Add a new workbook with one sheet
> > Set BaseWks = Workbooks.Add(xlWBATWorksheet).Worksheets(1)
> > Cnum = 1
> >
> > Can you add the sheet to an existing workbook instead of a new workbook?
> > "Ron de Bruin" wrote:
> >
> >> Download the example workbook
> >>
> >>
> >>
> >> --
> >>
> >> Regards Ron de Bruin
> >> http://www.rondebruin.nl/tips.htm
> >>
> >>
> >> "Mike Lewis" <(E-Mail Removed)> wrote in message news:0A7E4186-A61B-4DBB-B00B-(E-Mail Removed)...
> >> > Hello,
> >> >
> >> > I tried cutting and pasting, and I get an error that takes me back to the
> >> > top with yellow. Here is what I cut and paste. Sub RDB_Merge_Data() turned
> >> > yellow and Get_File_Names highlighted blue.
> >> >
> >> > Thoughts?
> >> >
> >> > Sub RDB_Merge_Data()
> >> > Dim myFiles As Variant
> >> > Dim myCountOfFiles As Long
> >> >
> >> > myCountOfFiles = Get_File_Names( _
> >> > MyPath:="C:\Documents and
> >> > Settings\lewism11\Desktop\Survey Subfile", _
> >> > Subfolders:=False, _
> >> > ExtStr:="*.xls", _
> >> > myReturnedFiles:=myFiles)
> >> >
> >> > If myCountOfFiles = 0 Then
> >> > MsgBox "No files that match the ExtStr in this folder"
> >> > Exit Sub
> >> > End If
> >> >
> >> > Get_Data _
> >> > FileNameInA:=True, _
> >> > PasteAsValues:=True, _
> >> > SourceShName:="", _
> >> > SourceShIndex:=1, _
> >> > SourceRng:="A1:G1", _
> >> > StartCell:="", _
> >> > myReturnedFiles:=myFiles
> >> >
> >> > End Sub
> >> >
> >> > "Ron de Bruin" wrote:
> >> >
> >> >> Start here
> >> >> http://www.rondebruin.nl/copy3.htm
> >> >>
> >> >> Try the add-in
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >>
> >> >> Regards Ron de Bruin
> >> >> http://www.rondebruin.nl/tips.htm
> >> >>
> >> >>
> >> >> "Mike Lewis" <(E-Mail Removed)> wrote in message news:E7F348DE-6D15-4D7F-87CC-(E-Mail Removed)...
> >> >> > Hello, I need some help. I have a survey that has one spreadsheet for each
> >> >> > customer. I also have a master excel spreadsheet that these need to roll up
> >> >> > to. Does anyone have suggestions of how I can roll up just the data from
> >> >> > these spreadsheets to the master spreadsheet. I am not sure that I want all
> >> >> > the spreadsheets to actually roll into the master spreadsheet or just the
> >> >> > data. I would love to be able to do this with a macro as this will be a
> >> >> > frequent survey.
> >> >> >
> >> >> > Thanks in advance for your help.
> >> >>
> >>

>
>

 
Reply With Quote
 
Ron de Bruin
Guest
Posts: n/a
 
      21st Jun 2008
You can add code to browse to the folder


Try

Sub RDB_Merge_Data()
Dim myFiles As Variant
Dim myCountOfFiles As Long
Dim oApp As Object
Dim oFolder

Set oApp = CreateObject("Shell.Application")

Set oFolder = oApp.BrowseForFolder(0, "Select folder", 512)
If Not oFolder Is Nothing Then
'run the other code
Else
Exit Sub
End If

myCountOfFiles = Get_File_Names( _
MyPath:=oFolder.Self.Path, _
Subfolders:=False, _
ExtStr:="*.xl*", _
myReturnedFiles:=myFiles)

If myCountOfFiles = 0 Then
MsgBox "No files that match the ExtStr in this folder"
Exit Sub
End If

Get_Data _
FileNameInA:=True, _
PasteAsValues:=True, _
SourceShName:="", _
SourceShIndex:=1, _
SourceRng:="A1:G1", _
StartCell:="", _
myReturnedFiles:=myFiles

End Sub



--

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


"Mike Lewis" <(E-Mail Removed)> wrote in message news:E83B2B5E-7CB6-4370-A1F6-(E-Mail Removed)...
> Ron de Bruin,
>
> Ok, since you seem to be a wealth of knowledge, I would like to find out
> something else from you. If I am giving this spreadsheet to another person,
> how can I make it where they will not need to go into the macro and change
> the "my Path" section. Can this be done from the spreadsheet itself,
> meaning, can there be a place put on the spreadsheet that would ask them to
> put in their path or something easier so that macro access is not needed?
>
> Thanks so much for your help...You have helped me tremendously.
>
> "Ron de Bruin" wrote:
>
>> > Can you add the sheet to an existing workbook instead of a new workbook?

>>
>> Yes
>>
>> Set BaseWks = Thisworkbook.Worksheets("Yourworksheet")
>>
>>
>> --
>>
>> Regards Ron de Bruin
>> http://www.rondebruin.nl/tips.htm
>>
>>
>> "Mike Lewis" <(E-Mail Removed)> wrote in message news:03C4E9FA-EAE2-4255-A4B8-(E-Mail Removed)...
>> > Got it.....Now, one last question. The section below....
>> >
>> > 'Add a new workbook with one sheet
>> > Set BaseWks = Workbooks.Add(xlWBATWorksheet).Worksheets(1)
>> > Cnum = 1
>> >
>> > Can you add the sheet to an existing workbook instead of a new workbook?
>> > "Ron de Bruin" wrote:
>> >
>> >> Download the example workbook
>> >>
>> >>
>> >>
>> >> --
>> >>
>> >> Regards Ron de Bruin
>> >> http://www.rondebruin.nl/tips.htm
>> >>
>> >>
>> >> "Mike Lewis" <(E-Mail Removed)> wrote in message news:0A7E4186-A61B-4DBB-B00B-(E-Mail Removed)...
>> >> > Hello,
>> >> >
>> >> > I tried cutting and pasting, and I get an error that takes me back to the
>> >> > top with yellow. Here is what I cut and paste. Sub RDB_Merge_Data() turned
>> >> > yellow and Get_File_Names highlighted blue.
>> >> >
>> >> > Thoughts?
>> >> >
>> >> > Sub RDB_Merge_Data()
>> >> > Dim myFiles As Variant
>> >> > Dim myCountOfFiles As Long
>> >> >
>> >> > myCountOfFiles = Get_File_Names( _
>> >> > MyPath:="C:\Documents and
>> >> > Settings\lewism11\Desktop\Survey Subfile", _
>> >> > Subfolders:=False, _
>> >> > ExtStr:="*.xls", _
>> >> > myReturnedFiles:=myFiles)
>> >> >
>> >> > If myCountOfFiles = 0 Then
>> >> > MsgBox "No files that match the ExtStr in this folder"
>> >> > Exit Sub
>> >> > End If
>> >> >
>> >> > Get_Data _
>> >> > FileNameInA:=True, _
>> >> > PasteAsValues:=True, _
>> >> > SourceShName:="", _
>> >> > SourceShIndex:=1, _
>> >> > SourceRng:="A1:G1", _
>> >> > StartCell:="", _
>> >> > myReturnedFiles:=myFiles
>> >> >
>> >> > End Sub
>> >> >
>> >> > "Ron de Bruin" wrote:
>> >> >
>> >> >> Start here
>> >> >> http://www.rondebruin.nl/copy3.htm
>> >> >>
>> >> >> Try the add-in
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >>
>> >> >> Regards Ron de Bruin
>> >> >> http://www.rondebruin.nl/tips.htm
>> >> >>
>> >> >>
>> >> >> "Mike Lewis" <(E-Mail Removed)> wrote in message
>> >> >> news:E7F348DE-6D15-4D7F-87CC-(E-Mail Removed)...
>> >> >> > Hello, I need some help. I have a survey that has one spreadsheet for each
>> >> >> > customer. I also have a master excel spreadsheet that these need to roll up
>> >> >> > to. Does anyone have suggestions of how I can roll up just the data from
>> >> >> > these spreadsheets to the master spreadsheet. I am not sure that I want all
>> >> >> > the spreadsheets to actually roll into the master spreadsheet or just the
>> >> >> > data. I would love to be able to do this with a macro as this will be a
>> >> >> > frequent survey.
>> >> >> >
>> >> >> > Thanks in advance for your help.
>> >> >>
>> >>

>>
>>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combining data from multiple worksheets into one Mark712 Microsoft Excel Misc 4 27th Jan 2010 07:36 PM
combining data multiple worksheets into one? kamartin Microsoft Excel Misc 5 10th Feb 2009 11:50 PM
combining data from multiple worksheets Taylor Microsoft Excel Discussion 2 14th Oct 2008 07:49 PM
Combining data from multiple worksheets. =?Utf-8?B?T2xtc3RlZDU3?= Microsoft Excel Misc 7 1st Aug 2007 01:12 AM
combining data from multiple worksheets =?Utf-8?B?YWxlbWNnbQ==?= Microsoft Excel Misc 2 9th Nov 2004 08:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:34 PM.