Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy A1:A13 from different workbook


Hi,

I have a workbook name apple.xls that required user to key in the
filename that they used. I do not know how many file the user will key
in.
Example filename they used: 1) a.xls 2) c.xls 3) q.xls 4) z.xls

Based on the filename, I would like to copy the value in the filename
of sheet 2 of A1:A13 into the apple.xls sheet 3 of B1:B13.

How to write a macro that can do this function?

Thank you.


--
ccl28
------------------------------------------------------------------------
ccl28's Profile: http://www.excelforum.com/member.php...o&userid=36095
View this thread: http://www.excelforum.com/showthread...hreadid=565869

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Copy A1:A13 from different workbook

hi,
Somethink like this might work for you. you would have to change the file
path your own file path.

Sub MacCopyStuff()
Dim fnam As String
fnam = InputBox("enter a file name")
Workbooks.Open Filename:= _
"C:\Documents and Settings\Owner\My Documents\" _
& fnam & ".xls"
'use your own file pathe
Sheets("sheet2").Activate
Range("A1:A13").Copy
Windows("yourfilename").Activate 'file name of the file that has this
macro
Sheets("Sheet3").Activate
Range("B1").PasteSpecial xlPasteAll
Windows(fnam).Activate
ActiveWindow.Close
End Sub
regards
FSt1
"ccl28" wrote:


Hi,

I have a workbook name apple.xls that required user to key in the
filename that they used. I do not know how many file the user will key
in.
Example filename they used: 1) a.xls 2) c.xls 3) q.xls 4) z.xls

Based on the filename, I would like to copy the value in the filename
of sheet 2 of A1:A13 into the apple.xls sheet 3 of B1:B13.

How to write a macro that can do this function?

Thank you.


--
ccl28
------------------------------------------------------------------------
ccl28's Profile: http://www.excelforum.com/member.php...o&userid=36095
View this thread: http://www.excelforum.com/showthread...hreadid=565869


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default Copy A1:A13 from different workbook

I have a workbook name apple.xls that required user to key in the
filename that they used. I do not know how many file the user will key
in.
Example filename they used: 1) a.xls 2) c.xls 3) q.xls 4) z.xls

Based on the filename, I would like to copy the value in the filename
of sheet 2 of A1:A13 into the apple.xls sheet 3 of B1:B13.


Hi Ccl8,

maybe you can use this simple codes:

Sub RetrieveValuetoApple()
Range("A1:A13").Value =
Workbooks("Book2").Sheets(1).Range("A1:A13").Value
End Sub

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default Copy A1:A13 from different workbook

Hi Again Ccl28,

maybe this is all you need :
Sub RetrieveValuetoApple()
Workbooks("Apple.xls").Sheets(3).Range("B1:B13").V alue =
Workbooks("a.xls").Sheets(2).Range("A1:A13").Value
Workbooks("Apple.xls").Sheets(3).Range("C1:C13").V alue =
Workbooks("c.xls").Sheets(2).Range("A1:A13").Value
Workbooks("Apple.xls").Sheets(3).Range("D1:D13").V alue =
Workbooks("q.xls").Sheets(2).Range("A1:A13").Value
Workbooks("Apple.xls").Sheets(3).Range("E1:E13").V alue =
Workbooks("z.xls").Sheets(2).Range("A1:A13").Value
End Sub

thanks,

HAlim

I have a workbook name apple.xls that required user to key in the
filename that they used. I do not know how many file the user will key
in.
Example filename they used: 1) a.xls 2) c.xls 3) q.xls 4) z.xls

Based on the filename, I would like to copy the value in the filename
of sheet 2 of A1:A13 into the apple.xls sheet 3 of B1:B13.

..com/showthread.php?threadid=565869

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 copy an image (or picture) from one workbook to a new sheetin another workbook Ruchir Excel Worksheet Functions 1 July 25th 08 07:29 AM
Excel-how to link source workbook to copy of destination workbook D Lynn Excel Worksheet Functions 1 May 29th 08 05:36 PM
loop through a column on a workbook copying data on each row to another workbook, then copy data back to the original workbook burl_rfc Excel Programming 1 April 1st 06 08:48 PM
Selecting data from 1 workbook to copy and paste to a 2nd workbook JackSpam Excel Programming 2 July 20th 05 02:33 AM
Copy a range of cells in an unopened workbook and paste it to the current workbook topstar Excel Programming 3 June 24th 04 12:50 PM


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

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"