Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Macro for cells that are less than 1 and conditioned on another ce

Trying to write a macro that takes a range of cells (J45:J2546) and checks to
see if any of the cells in this range are less than 1. But it needs to
verify that there is number greater than 1 in column A of the same row.
Then I need it to insert the number 1,000 into that cell.

Something sort of like .... IF J45<1 AND A1, then insert 1,000.

If anyone has suggestions, Thanks!!!!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Macro for cells that are less than 1 and conditioned on another ce

Sub dural()
Dim r As Range
Set r = Range("J45:J2546")
For Each rr In r
If rr.Value < 1 And rr.Offset(0, -9).Value 1 Then
rr.Value = 1000
End If
Next
End Sub

--
Gary''s Student - gsnu200850


"frenchdaddy" wrote:

Trying to write a macro that takes a range of cells (J45:J2546) and checks to
see if any of the cells in this range are less than 1. But it needs to
verify that there is number greater than 1 in column A of the same row.
Then I need it to insert the number 1,000 into that cell.

Something sort of like .... IF J45<1 AND A1, then insert 1,000.

If anyone has suggestions, Thanks!!!!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Macro for cells that are less than 1 and conditioned on anothe

Thanks a million, that was exactly what I needed.

"Gary''s Student" wrote:

Sub dural()
Dim r As Range
Set r = Range("J45:J2546")
For Each rr In r
If rr.Value < 1 And rr.Offset(0, -9).Value 1 Then
rr.Value = 1000
End If
Next
End Sub

--
Gary''s Student - gsnu200850


"frenchdaddy" wrote:

Trying to write a macro that takes a range of cells (J45:J2546) and checks to
see if any of the cells in this range are less than 1. But it needs to
verify that there is number greater than 1 in column A of the same row.
Then I need it to insert the number 1,000 into that cell.

Something sort of like .... IF J45<1 AND A1, then insert 1,000.

If anyone has suggestions, Thanks!!!!

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
How can I sum up several check boxes conditioned by a combo box? [email protected] Excel Discussion (Misc queries) 4 December 13th 08 12:22 PM
SUM conditioned to range Pedro AM Excel Worksheet Functions 6 February 8th 07 03:55 PM
conditioned functions John Excel Worksheet Functions 1 January 4th 06 03:55 PM
conditioned functions John Excel Worksheet Functions 1 January 4th 06 03:15 PM
help with a scatter graph of conditioned values uriel78 Charts and Charting in Excel 3 February 2nd 05 06:01 AM


All times are GMT +1. The time now is 12:55 PM.

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"