LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default If-Then in VBA

I am trying to create a button that will evaluate a cell
and based upon its value, enter one of 2 formulas. after
writing the code, it keeps returning a value that it
should notand I can't figure why.

Here is the Attached code

Sub manual312()
'
' manual312 Macro
' Macro recorded 4/15/2004 by jminken
'
Sheets("Reimbursement Sheet Global").Select

If check312 = 0 Then
Range("R32").Select
ActiveCell.FormulaR1C1 = Medicare_payment_312 * 1.2


ElseIf check312 0 Then

Range("R32").Select

ActiveCell.FormulaR1C1 = _
"=(R[-25]C[4]*R[-25]C)+(R[-23]C[4]*R[-23]C)+(R[-21]
C[4]*R[-21]C)"
Range("R34").Select


End If
'
End Sub

The problem arises in that the check312 cell is 0 and I
am getting the first formula.

Please help
 
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



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