Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Another Atempt

On Thu, 22 Dec 2005 06:35:54 +0800, PY & Associates wrote:

treat each of your modules as subroutines
if each of them works by itself, then

sub main()
for i = 1 to 15
read web subroutine 'just read, do not create new sheets
snapshot subroutine 'ditto
Sheets("Latest Snapshot").Range("J3:J17").Copy
Sheets("Chartdata").Cells(2, i+1).PasteSpecial Paste:=xlPasteValues
Application.Wait (Now + TimeValue("0:00:60"))
Next i
end sub


Sub main()
For i = 1 To 15
'read web subroutine 'just read, do not create new sheets
'snapshot subroutine 'ditto
Sheets("Latest Snapshot").Range("J3:J17").Copy
Sheets("Chartdata").Cells(2, i + 1).PasteSpecial Paste:=xlPasteValues
Application.Wait (Now + TimeValue("0:00:02"))
Next i
End Sub

The above works fine when tested in a new module. Sometimes when I try to
test this, I am prompted for a macro name. How do I assign it a macro
name? It might run when incorporated with the main code or placed in a new
module?

When I paste it into an existing module and test it, I get a Compile Error
(Variable not defined @ For i = 1 To 15
).

if you comment out read web and snapshot, change time value to 2 sec, you


I have now done that.

I am going to office now.
send further information to my private address, if you want.
I do not keep watching NG all day.

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



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