 |
| View previous topic :: View next topic |
| Author |
Message |
hoopla Newbie
Joined: 15 Mar 2004 Posts: 1
|
Posted: Mar 15th, 2004 10:31 AM Post subject: Copy & paste cells using VB macro |
|
|
Any help is appreciated,
Thanks for taking the time to read my question.
I working in an excel file (xyz.xls) that column "A" has many URLs - 1000. (Sheet1)
[link]
token=public&step=4&mid=4266752&pc=T9S%201J1
[link]
token=public&step=4&mid=4265895&pc=T5J%200H8
etc.etc.
What I would like to do is automatically open all 1000 URLs in excel (possibly one at a time) and select & copy specific cells (i.e. B14 and F13 etc) into a new worksheet (Sheet2).
For example: In the beginning I will have Sheet1 and Sheet2.
I open URLs as excel sheets.
When I open the URLs in excel the information that I want to extract is always located in the same cell [example: (Sheet3 cell G13) and (Sheet4 cell G13) display the "customers name".
Sheet2 will be the one that summarizes info from all other cells (Sheet3, Sheet4....Sheet999, etc.)
Once information is copied to Sheet2, then each worksheet will close before the new URL/sheet opens (so I will not run out of memory if I have 10,000 url/sheets)
Could you help me?
Thanking you in advance,
George |
|
| Back to top |
|
P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Mar 15th, 2004 02:03 PM Post subject: |
|
|
If you add a reference to the Microsoft Excel x.0 Object Library, you can do something like this if it helps :
[vb:1:11cc167779]Dim objE As Excel.Application
Set objE = New Excel.Application
objE.Workbooks.Open "C:\book1.xls"
Dim S As String
S = objE.Range("G13")
MsgBox S
objE.Range("A11") = S[/vb:1:11cc167779] _________________ No one is completely useless. They can at least be an example of what to avoid. |
|
| Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|