Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / June 2007

Tip: Looking for answers? Try searching our database.

How to do the coding on UNTIL loop?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Eric - 14 Jun 2007 13:28 GMT
Does anyone have any suggestions on how to do the coding on Macro?

[Loop for Until]
[Perform following code]

Workbooks.Open Filename:="C:\1.xls", UpdateLinks:=3
Workbooks("1.xls").Close savechanges:=True

Until 'C:\[Data.xls]Sheet1'!$A$1 >0
[Exit Until Loop]

Thank for any suggestions
Eric
Mike H - 14 Jun 2007 13:50 GMT
Eric,

Generally the format for a do loop is as follows

Sub sonic()
Do
Cells(1, 1).Value = Int((12 * Rnd) + 1)
Loop While Cells(1, 1).Value <> 10
End Sub

This simple loop writes a random number to A1 every loop and the loop exits
when A1 = 10. All pretty pointless but a demonstration of how it works.

Mike

> Does anyone have any suggestions on how to do the coding on Macro?
>
[quoted text clipped - 9 lines]
> Thank for any suggestions
> Eric
Eric - 14 Jun 2007 15:31 GMT
Thank everyone for suggestions

My requirement is to open the file at least once, if the value from
'C:\[Data.xls]Sheet1'!$A$1 >0, then re-open the file again, there is the
reason for this loop.
If I apply your code to my case, it shows as below,
Am I right?

Sub Eric()
Do
 Workbooks.Open Filename:="C:\1.xls", UpdateLinks:=3
 Workbooks("1.xls").Close savechanges:=True
Loop While 'C:\[Data.xls]Sheet1'!$A$1 >0
End Sub

> Eric,
>
[quoted text clipped - 24 lines]
> > Thank for any suggestions
> > Eric
Don Guillett - 14 Jun 2007 13:55 GMT
do until your criteria>0
 do stubb
loop

Signature

Don Guillett
SalesAid Software
dguillett1@austin.rr.com

> Does anyone have any suggestions on how to do the coding on Macro?
>
[quoted text clipped - 9 lines]
> Thank for any suggestions
> Eric
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.