PC Review


Reply
 
 
Croc
Guest
Posts: n/a
 
      30th Mar 2008
Hi, i need a macro, that would add 1 to a number in cell ex. A1 when
for ex. B2 is greater then 0.50.

I use RANDOM formula to generate number in B2. When generated number
is greater then 0.50 then it should add 1 to cell A1.

So when there is "27" in A1 and B2 generated 0.77 it should change A1
to 28, if not, it should leave it as A1 was.

Can any one help me?

Thanks, Martin
 
Reply With Quote
 
 
 
 
Mike
Guest
Posts: n/a
 
      30th Mar 2008
For looper = 1 To Range("B" & Rows.Count).End(xlUp).Row
Set cellPointer = Worksheets("Sheet1").Range("B" & looper)
If cellPointer > 0.5 Then
cellPointer.Offset(0, -1) = cellPointer.Offset(0, -1) + 1
End If
Next looper

"Croc" wrote:

> Hi, i need a macro, that would add 1 to a number in cell ex. A1 when
> for ex. B2 is greater then 0.50.
>
> I use RANDOM formula to generate number in B2. When generated number
> is greater then 0.50 then it should add 1 to cell A1.
>
> So when there is "27" in A1 and B2 generated 0.77 it should change A1
> to 28, if not, it should leave it as A1 was.
>
> Can any one help me?
>
> Thanks, Martin
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:29 PM.