Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Macro to copy data from one workbook to another

Hi,

I need to create a macro that opens up a specific excel file. This file has
data that is split into twelve different columns (one for each month). I need
this macro to create a msgbox that allows the user to select the month and
then copy all the data in that row to the other document.

Anyone have any ideas on this one?

Thanks in Advance!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Macro to copy data from one workbook to another

You say each month is in a column, then the user selects a specific colum
(month) and copies a row -- What row? assuming you mean column:

You can select a column with

Dim sh as Worksheet, bk as Workbook
Dim rng as Range
set bk = Workbooks.Open("C:\MyFolder\Myfile.xls")
on error resume next
set rng = Application.InputBox("select a column with your mouse",type:=8)
On error goto 0
if rng is nothing then
bk.close Savechanges:=false
exit sub
end if
rng.EntireColumn.Copy Destination:= _
sh.Columns(3)
bk.close Savechanges:=False

--
Regards,
Tom Ogilvy

--
Regards,
Tom Ogilvy


"supamari0" wrote:

Hi,

I need to create a macro that opens up a specific excel file. This file has
data that is split into twelve different columns (one for each month). I need
this macro to create a msgbox that allows the user to select the month and
then copy all the data in that row to the other document.

Anyone have any ideas on this one?

Thanks in Advance!

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
Copy most recent data from one workbook to another with a Macro Eli[_4_] Excel Discussion (Misc queries) 0 October 2nd 08 11:20 PM
$%Macro to Copy from one workbook to other when matching data Tiger Excel Discussion (Misc queries) 0 July 30th 07 08:42 AM
Macro Help. Copy data from 1 workbook to another on next available Howeecow Excel Discussion (Misc queries) 0 June 6th 07 08:29 PM
Macro to copy data into another workbook yukon_phil Excel Discussion (Misc queries) 0 July 26th 06 05:29 PM
macro to copy range data from another workbook steven_thomas[_3_] Excel Programming 0 January 18th 06 07:01 PM


All times are GMT +1. The time now is 11:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"