IF statements across Worksheets

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Novice excel user here.

I am trying to use the insert function feature to insert a IF statement to
make a cell a 1 or 0 based on the value of a cell on a different worksheet.
The command I am using is as follows:

IF(Worksheets("RollUp").Cells(5,4) = 100, 1, 0)

I get an error at the Cells method.

Does anyone know the proper command to due this, or is it not possible.

thanks for the help!

rgold
 
You have a mix of Excel worksheet function and VBA.

Do you want a worksheet function?

=IF(Rollup!D5=100,1,0)

VBA?

Sub goop()
With Sheets("Sheet2").Range("A1")
If Sheets("Rollup").Cells(5, 4) = 100 Then
.Value = 1
Else
.Value = 0
End If
End With
End Sub


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top