Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / April 2007

Tip: Looking for answers? Try searching our database.

IF statements across Worksheets

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rgold - 18 Apr 2007 21:04 GMT
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
Gord Dibben - 18 Apr 2007 21:39 GMT
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

>Novice excel user here.
>
[quoted text clipped - 11 lines]
>
>rgold
rgold - 18 Apr 2007 22:18 GMT
Great!  I wanted the worksheet function not the VBA.

Thanks!!!

rgold

> You have a mix of Excel worksheet function and VBA.
>
[quoted text clipped - 31 lines]
> >
> >rgold
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.