Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » Visual Basic for Applications

Post new topic   Reply to topic
Copy & paste cells using VB macro
View previous topic :: View next topic  
Author Message
hoopla
Newbie


Joined: 15 Mar 2004
Posts: 1

PostPosted: Mar 15th, 2004 10:31 AM    Post subject: Copy & paste cells using VB macro Reply with quote

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
View user's profile Send private message
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Mar 15th, 2004 02:03 PM    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » Visual Basic for Applications All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic