Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Macro to import multiple sheets

Please disregard my previous posting.. I explained it very badly !!!!

I have a macro that will let me search for the location of an Excel file and
import the data from that file-

Dim wb As Workbook
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Application.Dialogs(xlDialogOpen).Show ThisWorkbook.Path
Set wb = ActiveWorkbook
wb.ActiveSheet.Range("A4:E30").Copy _
ThisWorkbook.Sheets("Non Account Activity - Brokaw").Range("CA4")
wb.Close False
Application.DisplayAlerts = True
Application.ScreenUpdating = True


What I would like to do is modify this so that I can source 2 different
sheets in the same file and have the data from both of them
imported at the same time..

Is this possbile ?





--
Thanks

Larry
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default Macro to import multiple sheets

Hi
You need 2 copies of this line

wb.ActiveSheet.Range("A4:E30").Copy _
ThisWorkbook.Sheets("Non Account Activity - Brokaw").Range("CA4")

replace Activesheet with Worksheets("TheSheetName") in each case and
the range info as required.
regards
Paul

On Feb 11, 9:35*pm, Larry Fitch
wrote:
Please disregard my previous posting.. I explained it very badly !!!!

I have a macro that will let me search for the location of an Excel file and
import the data from that file-

Dim wb As Workbook
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Application.Dialogs(xlDialogOpen).Show ThisWorkbook.Path
Set wb = ActiveWorkbook
wb.ActiveSheet.Range("A4:E30").Copy _
ThisWorkbook.Sheets("Non Account Activity - Brokaw").Range("CA4")
wb.Close False
Application.DisplayAlerts = True
Application.ScreenUpdating = True

What I would like to do is modify this so that I can source 2 different
sheets in the same file and have the data from both of them
imported at the same time..

Is this possbile ?

--
Thanks

Larry


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Macro to import multiple sheets


Thanks Very much Paul !!!

That did the trick !!
--
Thanks

Larry


" wrote:

Hi
You need 2 copies of this line

wb.ActiveSheet.Range("A4:E30").Copy _
ThisWorkbook.Sheets("Non Account Activity - Brokaw").Range("CA4")

replace Activesheet with Worksheets("TheSheetName") in each case and
the range info as required.
regards
Paul

On Feb 11, 9:35 pm, Larry Fitch
wrote:
Please disregard my previous posting.. I explained it very badly !!!!

I have a macro that will let me search for the location of an Excel file and
import the data from that file-

Dim wb As Workbook
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Application.Dialogs(xlDialogOpen).Show ThisWorkbook.Path
Set wb = ActiveWorkbook
wb.ActiveSheet.Range("A4:E30").Copy _
ThisWorkbook.Sheets("Non Account Activity - Brokaw").Range("CA4")
wb.Close False
Application.DisplayAlerts = True
Application.ScreenUpdating = True

What I would like to do is modify this so that I can source 2 different
sheets in the same file and have the data from both of them
imported at the same time..

Is this possbile ?

--
Thanks

Larry


.

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 to Automate Text Import for Multiple Files [email protected] Excel Programming 7 February 14th 07 09:40 PM
Import multiple text files (Macro) Thr33of4 Excel Discussion (Misc queries) 0 September 19th 06 02:19 AM
how do i use import to consolidate data from multiple sheets Naveen Excel Worksheet Functions 1 April 14th 06 12:41 PM
Import multiple csv files into current workbook as separate sheets santosh Excel Programming 3 January 24th 06 05:06 PM
Need to import multiple files with a macro HatTrick Excel Programming 0 August 5th 04 03:57 PM


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