Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default For Each offset range

Please help! I need to "do stuff" if column I is greater than 0...but
this isn't working.

Dim ws1 As Worksheet
For Each row In ws1
If Range.Offset(0, 9).Text 0 Then
do stuff
End If
Next

Thanks!
Mike


*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default For Each offset range

Sub DoStuffForMike()
Dim rngToSearch As Range
Dim rngCurrent As Range
Dim wks As Worksheet

Set wks = Sheets("Sheet1")
Set rngToSearch = wks.Range("I2", wks.Range("I65535").End(xlUp))
For Each rngCurrent In rngToSearch
If rngCurrent.Value 0 Then
MsgBox "Do stuff for Mike with " & rngCurrent.Address
End If
Next rngCurrent

End Sub
--
HTH...

Jim Thomlinson


"Michael Smith" wrote:

Please help! I need to "do stuff" if column I is greater than 0...but
this isn't working.

Dim ws1 As Worksheet
For Each row In ws1
If Range.Offset(0, 9).Text 0 Then
do stuff
End If
Next

Thanks!
Mike


*** Sent via Developersdex http://www.developersdex.com ***

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default For Each offset range

Excellent Thanks...one last piece...for the "do stuff" part, how can I
select that row to copy it?

Thanks again.

*** Sent via Developersdex http://www.developersdex.com ***
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
OFFSET Range Daniel Excel Worksheet Functions 1 October 18th 07 03:12 PM
Problem with Range.Cells.Offset and Range.Cells( row + offset, column) [email protected] Excel Programming 2 August 22nd 05 05:25 AM
range offset bbxrider[_2_] Excel Programming 7 July 20th 05 10:10 AM
Using Offset to name a range Jennifer Excel Worksheet Functions 3 June 15th 05 10:07 AM
Offset Range hotherps[_113_] Excel Programming 11 August 20th 04 12:38 AM


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