Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default simple for each

any help is appreciated... I am not getting it to select or evaluate each rg

Range("b65536").End(xlUp).Select
rnglst = ActiveCell.Row

For Each rg In Range("a10:" & Range("a" & rnglst))
rg.Select
If rg 0 Then
rg.Copy
rg.Offset(0, 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
End If
Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default simple for each

Give this a try. It is a little more compact than your original post...

dim rg as range

For Each rg In Range(Range("a10:"), cells(Rows.count, "A").end(xlUp))
If rg 0 Then rg.Offset(0, 1).Value = rg.value
Next rg
--
HTH...

Jim Thomlinson


"John" wrote:

any help is appreciated... I am not getting it to select or evaluate each rg

Range("b65536").End(xlUp).Select
rnglst = ActiveCell.Row

For Each rg In Range("a10:" & Range("a" & rnglst))
rg.Select
If rg 0 Then
rg.Copy
rg.Offset(0, 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
End If
Next

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default simple for each

I did it the first way because I was testing the bottom row in colum B...
there is still probablly an easier way but this one won't work for my set up.
But the first post works great... thank you again

"Jim Thomlinson" wrote:

Give this a try. It is a little more compact than your original post...

dim rg as range

For Each rg In Range(Range("a10:"), cells(Rows.count, "A").end(xlUp))
If rg 0 Then rg.Offset(0, 1).Value = rg.value
Next rg
--
HTH...

Jim Thomlinson


"John" wrote:

any help is appreciated... I am not getting it to select or evaluate each rg

Range("b65536").End(xlUp).Select
rnglst = ActiveCell.Row

For Each rg In Range("a10:" & Range("a" & rnglst))
rg.Select
If rg 0 Then
rg.Copy
rg.Offset(0, 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
End If
Next

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
IF formula-simple question; simple operator Rich D Excel Discussion (Misc queries) 4 December 6th 07 03:36 PM
Simple problem, simple formula, no FUNCTION ! Ron@Buy Excel Worksheet Functions 6 September 28th 07 04:51 PM
Simple Simple Excel usage question BookerW Excel Discussion (Misc queries) 1 June 23rd 05 10:06 PM
Make it more simple or intuitive to do simple things Vernie Charts and Charting in Excel 1 March 16th 05 04:01 AM
simple question, hopefully a simple answer! Matt B Excel Programming 5 January 13th 04 08:43 PM


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