Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Data import/extraction question


Hey All,

I receive a weekly statisical report (in excel) from which data must b
added to an existing monthly report (in excel). After researching an
writing a simple macro, I realized I had no idea what I was doing an
needed dire help. This is what I need the macro to do.

1) Prompt the user to choose which file from which to extract data.
(perhaps a "Application.GetOpenFilename"?)

2) Extract certain cell specific data from a specific worksheet o
spreadsheet #2, and add it to existing cell/worksheet specific data i
spreadsheet #1.

3) Be able to reformat and reuse this macro for other uses. (Once I se
how the macro works, I should be able to figure this out)

Any help would be greatly appreciated. Thank

--
tempac
-----------------------------------------------------------------------
tempacc's Profile: http://www.excelforum.com/member.php...fo&userid=2440
View this thread: http://www.excelforum.com/showthread.php?threadid=38008

  #2   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Data import/extraction question

This may help some. Without details about what is to be copied where, it is
difficult to address that part of your question.

this opens a workbook, then copies the data from cell "A1" of the
activesheet (of the source workbook) to my destination sheet (Sheet1 - I'm
using the codename for the worksheet). the destination range is column A of
the next available row of the worksheet.


Sub ExtractData()
Dim SourceWkBk As Workbook
Dim DestWkSht As Worksheet
Dim DestRow As Long

On Error Resume Next
Set DestWkSht = ThisWorkbook.Worksheets(Sheet1.Index)

If IsEmpty(DestWkSht.UsedRange) Then
DestRow = 1
Else: DestRow = DestWkSht.UsedRange.Rows.Count + 1
End If

If Application.Dialogs(xlDialogOpen).Show Then
Set SourceWkBk = ActiveWorkbook
Else: Exit Sub
End If

SourceWkBk.ActiveSheet.Range("A1").Copy _
DestWkSht.Cells(DestRow, 1)

SourceWkBk.Close

End Sub


"tempacc" wrote:


Hey All,

I receive a weekly statisical report (in excel) from which data must be
added to an existing monthly report (in excel). After researching and
writing a simple macro, I realized I had no idea what I was doing and
needed dire help. This is what I need the macro to do.

1) Prompt the user to choose which file from which to extract data.
(perhaps a "Application.GetOpenFilename"?)

2) Extract certain cell specific data from a specific worksheet on
spreadsheet #2, and add it to existing cell/worksheet specific data in
spreadsheet #1.

3) Be able to reformat and reuse this macro for other uses. (Once I see
how the macro works, I should be able to figure this out)

Any help would be greatly appreciated. Thanks


--
tempacc
------------------------------------------------------------------------
tempacc's Profile: http://www.excelforum.com/member.php...o&userid=24406
View this thread: http://www.excelforum.com/showthread...hreadid=380085


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
Data Import Question Steve Haack Excel Discussion (Misc queries) 2 May 20th 09 10:37 PM
Help with Text import and data extraction Jim G Excel Discussion (Misc queries) 19 December 21st 07 05:07 AM
Excel 2007 Import data question Stevens Setting up and Configuration of Excel 0 December 11th 07 09:22 PM
Extraction Question maperalia Excel Discussion (Misc queries) 14 December 17th 06 03:32 AM
a sort of GROUP BY data extraction question... jc Excel Worksheet Functions 2 January 9th 06 07:49 PM


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