LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 26
Default Loop Until non-incrementing cell condition met.

Hi,

I am a VBA dummy. I am stuck on the following:

I have a cell GJ1 that will either have a 1 or a 0 value. My routine needs to
loop until GJ1 changes from 0 to 1. The solutions that I have seen on the
Internet use counters to count loops until a condition is met. In my case,
counters or incrementing is not applicable since the condition that
determines if GJ1 is 1 is not based on counters or incrementing but on user
input. The example below is what I am trying. I can get the loop to work,
but then it just keeps looping infinitely.

Sub PasteValuesTill()

' The code below must loop until cell GJ1=1. GJ1 can only have values of 0 or
1.
'
Sheets("ThisSheet").Select
Range("E5:G5").Select
Selection.Copy
Range("F2:G2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Do Until GJ1 = 1
Loop

End Sub

--
Message posted via http://www.officekb.com

 
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
Incrementing a formula within an excel cell James C. Excel Worksheet Functions 9 June 24th 09 07:08 AM
Incrementing cell addresses LaRana! Excel Worksheet Functions 1 March 1st 08 04:19 AM
Incrementing cell reference Paul Mugleston[_2_] Excel Discussion (Misc queries) 1 January 10th 08 04:06 PM
incrementing mm/yy based on value in other cell George Excel Worksheet Functions 2 March 1st 06 03:41 AM
Incrementing Cell Numbers Lance W. Grimes Excel Discussion (Misc queries) 1 March 8th 05 07:51 PM


All times are GMT +1. The time now is 07:26 AM.

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"