Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 683
Default Row incrementation not working.

I am trying to compare rows on two worksheets in same workbook. The compare
should work but when I try to increment down using hte counter it blows up. I
have a little experience with c and this works there. All help appreciated!

Sub Compare_Tests()
Dim i As Integer ' use to increment thru worksheet
Dim cutrange As Range ' new data to move if changed

i = 3 'counter

Do Until IsEmpty(Cells(i, 1)) 'runs entire length of all sheets in variable
sizes
If Worksheets("well tests").Range("si") <
Worksheets("sheet1").Range("ti") Then ' if AOF <
Set cutrange = ("Hi:Oi") 'cut observations
cutrange.Cut Destination:=Worksheets("well tests").Range("Gi:Ni") ' paste
Worksheets("well tests").Range("ai").Value = "new" ' identify as new
End If
i = i + 1 ' move down a row
Exit Do
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Row incrementation not working.

Sub Compare_Tests()
Dim i As Integer ' use to increment thru worksheet
Dim cutrange As Range ' new data to move if changed

i = 3 'counter

Do Until IsEmpty(Cells(i, 1)) 'runs entire length of all sheets in variable
sizes
If Worksheets("well tests").Range("s" & i) < _
Worksheets("sheet1").Range("t" & i) Then
' if AOF <
Set cutrange = ("H" & i & ":O" & i) 'cut observations
cutrange.Cut Destination:=Worksheets("well tests").Range("G" & _
i & ":" & N" & i) ' paste
Worksheets("well tests").Range("a" & i).Value = "new" ' identify as
new
End If
i = i + 1 ' move down a row
Exit Do

Spacing is important. i & and i& are two different things (for example)

i& means i has a type of long (implicit typing)

i & uses & as a concatenation operator

you want the latter.

--
Regards,
Tom Ogilvy


"Brian" wrote in message
...
I am trying to compare rows on two worksheets in same workbook. The

compare
should work but when I try to increment down using hte counter it blows

up. I
have a little experience with c and this works there. All help

appreciated!

Sub Compare_Tests()
Dim i As Integer ' use to increment thru worksheet
Dim cutrange As Range ' new data to move if changed

i = 3 'counter

Do Until IsEmpty(Cells(i, 1)) 'runs entire length of all sheets in

variable
sizes
If Worksheets("well tests").Range("si") <
Worksheets("sheet1").Range("ti") Then ' if AOF <
Set cutrange = ("Hi:Oi") 'cut observations
cutrange.Cut Destination:=Worksheets("well tests").Range("Gi:Ni") '

paste
Worksheets("well tests").Range("ai").Value = "new" ' identify as new
End If
i = i + 1 ' move down a row
Exit Do



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 683
Default Row incrementation not working.

Thanks Tom for the quick reply. I did not know about theimplicit type siiue
(not in my book)

"Tom Ogilvy" wrote:

Sub Compare_Tests()
Dim i As Integer ' use to increment thru worksheet
Dim cutrange As Range ' new data to move if changed

i = 3 'counter

Do Until IsEmpty(Cells(i, 1)) 'runs entire length of all sheets in variable
sizes
If Worksheets("well tests").Range("s" & i) < _
Worksheets("sheet1").Range("t" & i) Then
' if AOF <
Set cutrange = ("H" & i & ":O" & i) 'cut observations
cutrange.Cut Destination:=Worksheets("well tests").Range("G" & _
i & ":" & N" & i) ' paste
Worksheets("well tests").Range("a" & i).Value = "new" ' identify as
new
End If
i = i + 1 ' move down a row
Exit Do

Spacing is important. i & and i& are two different things (for example)

i& means i has a type of long (implicit typing)

i & uses & as a concatenation operator

you want the latter.

--
Regards,
Tom Ogilvy


"Brian" wrote in message
...
I am trying to compare rows on two worksheets in same workbook. The

compare
should work but when I try to increment down using hte counter it blows

up. I
have a little experience with c and this works there. All help

appreciated!

Sub Compare_Tests()
Dim i As Integer ' use to increment thru worksheet
Dim cutrange As Range ' new data to move if changed

i = 3 'counter

Do Until IsEmpty(Cells(i, 1)) 'runs entire length of all sheets in

variable
sizes
If Worksheets("well tests").Range("si") <
Worksheets("sheet1").Range("ti") Then ' if AOF <
Set cutrange = ("Hi:Oi") 'cut observations
cutrange.Cut Destination:=Worksheets("well tests").Range("Gi:Ni") '

paste
Worksheets("well tests").Range("ai").Value = "new" ' identify as new
End If
i = i + 1 ' move down a row
Exit Do




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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing the incrementation when "puliing" cell values down a colu Matt G[_2_] Excel Worksheet Functions 5 November 4th 08 01:15 PM
Preventing incrementation of section of a formulae whatzzup New Users to Excel 1 August 17th 07 04:05 AM
Preventing incrementation of section of a formulae Mike H New Users to Excel 0 August 17th 07 02:07 AM
Prevent auto incrementation of formula Marie Bayes Excel Discussion (Misc queries) 5 March 21st 07 12:57 PM
Scroller Incrementation unique Charts and Charting in Excel 1 December 4th 05 10:20 PM


All times are GMT +1. The time now is 05:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"