LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Using IF Formula

Copy tis into a VBA module so you can read it


Sub NS()
Dim R As Long, LR As Long, S3r
'S3r is sheet3 row x
'Application.ScreenUpdating = False 'makes the macro run
faster by not updating video
'you may want to comment out the above line if you want to
watch the macro run
ActiveSheet.Cells.SpecialCells
(xlCellTypeLastCell).Activate 'Finds the last cell in the
WS so the loop knows when to stop
LR = ActiveCell.Row 'Address of the last row in the WS
Range("A1").Select 'Change A1 to the cell address you want
the loop to start at
S3r = 1
Do
If ActiveCell.Value = 0 And ActiveCell.Value < "" Then
Worksheets("Sheet3").Range("H" & S3r).Value = "Yes" 'put
the value "yes" in cloumn H row x
ActiveCell.Offset(14).Activate 'moves the cursor (active
cell) 14 rows down
R = ActiveCell.Row 'Sets R = to the current row so we can
test if the loop should continue
S3r = S3r + 1
Else
ActiveCell.Offset(14).Activate 'moves the cursor (active
cell) 14 rows down
R = ActiveCell.Row
End If
Loop Until R = LR Or R LR
End Sub

Marty

-----Original Message-----

I would like to use the IF Formula to check the contents

of a cell and
place a "Yes" if true or nothing if False. The standard

formula of IF
(A27=0,"Yes","") doesn't work in VBA because of the

quotation marks for
some reason. How do I do it?

Also, I would like to counter the rows by 14 and place

the result in a
column. In other words, check A27 and place the result

in H1 on
Sheet3. Then check A41 and place the result in H2 and so

on. Thanks.
Tom - you've been a huge help!! I unfortunately learn by

example - I
wish there was a site or reference materials available

that catered to
the very beginner! Thanks again!!


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from

http://www.ExcelForum.com/

.

 
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
Commenting custom formula fields/formula on formula editor Muxer Excel Programming 2 July 24th 03 01:02 AM


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

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"