Checkbox linked to calcs - 117612

Hi, I'm trying to link a checkbox to do specific calculations. 
Assuming that it's possible, I have the following dilemma: 
When checkbox is checked, n=n-a, when unchecked, n. 

I wrote the following code but it doesn't work
Dim withMobile As CheckBox

   If withMobile.Value = True Then
   
    Range("U66").Select
    ActiveCell.FormulaR1C1 = "=RC[60]+RC[90]+RC[102]+RC[114]+RC[126]-RC[108]"
    Selection.AutoFill Destination:=Range("U66:U99"), Type:=xlFillDefault
    
    Range("V66").Select
    ActiveCell.FormulaR1C1 = "=RC[60]+RC[90]+RC[102]+RC[114]+RC[126]-RC[108]"
    Selection.AutoFill Destination:=Range("V66:V99"), Type:=xlFillDefault
    
    Range("W66").Select
    ActiveCell.FormulaR1C1 = _
        
"=IF(FISCAL_YTD=""YES"",RC[-2]-RC[-1],IFERROR(RC[-2]-RC[-1],0))-RC[108]"
    Selection.AutoFill Destination:=Range("W66:W99"), Type:=xlFillDefault
    
    Range("L66").Select
    ActiveCell.FormulaR1C1 = "=RC[60]+RC[90]+RC[102]+RC[114]+RC[126]-RC[108]"
    Selection.AutoFill Destination:=Range("L66:L99"), Type:=xlFillDefault
      
    ElseIf withMobile.Value = False Then
    
    Range("U66").Select
    ActiveCell.FormulaR1C1 = "=RC[60]+RC[90]+RC[102]+RC[114]+RC[126]"
    Selection.AutoFill Destination:=Range("U66:U99"), Type:=xlFillDefault
    
    Range("V66").Select
    ActiveCell.FormulaR1C1 = "=RC[60]+RC[90]+RC[102]+RC[114]+RC[126]"
    Selection.AutoFill Destination:=Range("V66:V99"), Type:=xlFillDefault
    
    Range("W66").Select
    ActiveCell.FormulaR1C1 = _
        "=IF(FISCAL_YTD=""YES"",RC[-2]-RC[-1],IFERROR(RC[-2]-RC[-1],0))"
    Selection.AutoFill Destination:=Range("W66:W99"), Type:=xlFillDefault
    
    Range("L66").Select
    ActiveCell.FormulaR1C1 = "=RC[60]+RC[90]+RC[102]+RC[114]+RC[126]"
    Selection.AutoFill Destination:=Range("L66:L99"), Type:=xlFillDefault
            
   End If
 
    
End Sub

Could anyone please help?
0
Utf
3/1/2010 9:54:01 AM
excel.programming 6508 articles. 2 followers. Follow

0 Replies
754 Views

Similar Articles

[PageSpeed] 32

Reply:

Similar Artilces:

How can I link to a specific worksheet from a webpage?
When I am on a webpage, I want to click a link that then automatically links to a specific worksheet in a excelwork book. How? Already solved enter *.xls#Sheet1!A1 RMF "RMF" wrote: > When I am on a webpage, I want to click a link that then automatically links > to a specific worksheet in a excelwork book. How? ...

update a link to a CSV
How can I refresh a link to a CSV file without re-loading the CSV? It may vary somewhat depending on what version of Excel and how the 'link' was actually created, but if it is an OLE link you should be able to go to Edit>Links and use the features of the dialog box. If 'Links' is dimmed in the Edit Menu, then you don't actually have a link. In that case, go to Data>Refresh or View>Toolbars & select the External Data toolbar (if it isn't already displayed). Use the red ! To refresh the data. Should neither options work out, post back with more info. HTH...

Problem With Deferral Check Links
Hi.. When i Do Deferral Check Links in File Maintenance. I am getting an error message "A remove range operation on table 'PP_File_Maintenance_Error_Log' cannot find the table. On clicking the more Info button. These messages are displayed " [Microsoft][ODBC SQL Server Driver][SQL Server]Could not find stored procedure 'TEST.dbo.zDP_PP400004L_1'. [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'TEST.dbo.PP400004'. " In the database these two objects are not present. Can You Pl. tell me what to do about it. Thanks These do not...

GetDocument( ) link error
I am getting the following link error when I call GetDocument( ) from within my CView class. LNK2019: unresolved external symbol "public: class CGUI_WhidbeyDoc * __thiscall CGUI_WhidbeyView::GetDocument(void)const " (?GetDocument@CGUI_WhidbeyView@@QBEPAVCGUI_WhidbeyDoc@@XZ) referenced in function "public: virtual int __thiscall CGUI_WhidbeyView::OnCreate(struct tagCREATESTRUCTA *)" (?OnCreate@CGUI_WhidbeyView@@UAEHPAUtagCREATESTRUCTA@@@Z) Any ideas why? Thanks. Jess Check GetDocument implementation is provided Class wizard will generate two GetDocument functio...

Link restriction
I get this message when ever I try to open a web address link in a email. The operation has been cancelled due to a restriction in effect on this computer. Please contact your system administrator. It was working fine only a couple of weeks ago, have added or changed any thing on computer. It is an error caused by Internet Explorer see http://www.slipstick.com/problems/link_restrict.htm -- Peter Please Reply to Newsgroup for the benefit of others Requests for assistance by email can not and will not be acknowledged. "dont@hotmail.com" <donthotmailcom...

How do I update links from .xls sheets to .xlms sheets
I have thousands of links to many consolidated spreadsheets created in Excel 2003. Now that I use Excel 2007, how do I convert the links without breaking them. On Apr 21, 2:06=A0pm, June <J...@discussions.microsoft.com> wrote: > I have thousands of links to many consolidated spreadsheets created in Ex= cel > 2003. =A0Now that I use Excel 2007, how do I convert the links without br= eaking > them. After making a copy of your workbook, try to search and replace ".xls" with ".xlms" Hope this helps, Chris M. It's not clear what you'v...

Deleting / Disabling the Links
Hello, I have got 2 queries. First one: I have got a workbook which has so many links that points to various unknown files. I have deleted some of the links by manually scanning the various sheets. but still i am left with some links which i could not find manually.. I have even cleared all the names in the workbook. Still no use. I looked into Edit->Links, i can see one link, but unfortunately there is no delete button with which i can remove the link. Can anybody help me how to remove the unknown link in the book? Thanks. Second one: Continuing from my prev question, wheneve...

Linking to Max result?
Hi Guys, I dont know where to start with this one! basically on a figures sheet I am displaying a table with lines showing the highest amounts on another sheet based on their category. (=MAX(data!AZ2:AZ65534)) now on this other sheet it has a line for each 'entry', on one of the cells for each 'entry' are the numbers that I'm maxing to give a highest figure. Now what I would love to be able to do, is hyperlink that formula that is showing the highest entry, so that when you click on it it takes to the other sheet and shows you its answer (the entry with the highest amoun...

Get space between a checkbox and text in a CButton with BS_AUTOCHECKBOX
Hi, I have created a CButton with BS_AUTOCHECKBOX style and I would like to be able to resize my control to fit the text. So I know how to calculate the text width but how can I know the space taken by the checkbox + the space bewteen the checkbox and my text ? THe way I solved this was to create, on my dialog, a button which had no characters in it, just the space. This was a hidden, disabled control. Then I used this to get both the height and the width I needed for the basic button and added to the width the GetTextExtent value. This is the safest way to create buttons, because you c...

Object Linking & embedding error
An .xls attachment give the 'cannot use object linking & embedding error' The file fails to open and appears on screen for just a second. Any ideas! where the problem is! Sunil I' ve run into the same error, and am to the point that its time to throw this piece out the window. Has a solution for this problem been found? OS. win 2000 pro. PG. Office 2000 error. cannot open object linking and enbedding. I had the same error on another PC and was able to re-install the pg. and it stopped. Go figure.... ------------------------------------------------ ~~ Message posted...

FRx
I have to refer multiple columns from excel into appropriate columns. Am refering from only one sheet. I have a row format, where i have "link to worksheet". I couldn't able to enter entire cell mapping as below: B=C12,C=E12,D=I12,E=K12,G=M12,H=O12,I=S12,J=U12,L=W12,M=Y12,N=AC12,O=AE12,Q=AF12,R=AH12,S=AL12,T=AN12,V=AP12,W=AR12,X=AV12,Y=AX12,AA=AZ12,AB=BB12,AC=BF12,AD=BH12,AF=BJ12,AG=BL12,AH=BP12,AI=BR12,AK=BT12,AL=BV12,AM=BX12,AN=CB12,AP=CD12,AQ=CF12,AR=CJ12,AS=CL12,AU=CN12,AV=CP12,AW=CT 12,AX=CV 12,AZ=CX 12,BA=CZ 12,BB=DD12,BC=DF12,BE=DH12,BF=DJ12,BG=DN12,BH=DP12,BJ=DR 12,BK=...

How do I link horizontal cells vertically?
I'd like to copy a link vertically, but the cells to link to are horizontal. How do I do this? Something like: =INDIRECT("A"&COLUMN(A1)) copied across HTH JG -- pinmaster ------------------------------------------------------------------------ pinmaster's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=6261 View this thread: http://www.excelforum.com/showthread.php?threadid=497720 Since you said "copy a link", you *can't* use "Paste Special" & "Transpose". So, try this: Original data in A1 to Z1, E...

can you help by make link with tow worksheet
I'm looking to make link with tow worksheet more clearly: i made equation in cells worksheet -1 a1 + a2 : print result in cell A1 in worksheet -2 and thankyou for help -- nader ------------------------------------------------------------------------ nader's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=10881 View this thread: http://www.excelforum.com/showthread.php?threadid=383968 Type in: =Sheet1!A1+Sheet1!A2 Place in Cell A1 of worksheet -2. Or, place the cursor in the desired cell of worksheet - 2 and click "=". Then click on the wo...

Moved spreadsheet changed link path
I have a spreadsheet that has 20 links that are to other worksheets within a directory. The main file is on a network drive that is known as P:\ in our environment. My client has linked these 20 other worksheets using P:\Finance within the main file. To troubleshoot a separate issue, I have copied the file locally to my c:\ drive. Now all 20 links are referencing the path c:\Finance. The folder path is the same as the network drive, however instead of P:\ it changed to C:\. Any idea of why? The hyperlink base in the properties of the file is empty. Any suggestions? If yo...

update of links with no prompt
I have a spreadsheet with links to another one. When the user opens the destination sheet I want the links to be updated automatically without a prompt. (but just for this sheet) This is apparently possible (Excel 2003) by choosing Edit menu - Links - Startup prompt and choosing 'dont display the alert and update links. But even though thisis set correctly I still get the alert Any ideas Thank you -- Patrick There is a user setting that can supersede this setting. Tools|options|Edit tab Ask to update automatic links If I (as a one of your users) change this to always ask, then...

clicking on email links is restricted by system?
All of a sudden if I try to clik on a link in a email, the system says it is restricted see your administrator? I have no Administrator. It always worked before? Feel free to read the countless posts here that have answered your question before you post yet another. Since you have failed in that endeavor, here is a special post just for you: http://www.slipstick.com/problems/link_restrict.htm -- Russ Valentine "Restricted clicking on email links" <Restricted clicking on email links@discussions.microsoft.com> wrote in message news:0BFDBA53-EBDE-49B0-B4F3-1EF...

A Cell linked between 2ExcelFiles, changes not seen in IE(inweb)
Hi, I have 2 Excel files in Server. C17 is the Cell No. in Both the sheets are linked. (i.e) for example i have the 2 excel files named A & B. if any changes have done in the A.xls in C17 cell then the B.xls C17 will have the same data & Vice Versa. Its working fine in the server when i try. I created a webpage & given a link to open this file. When the user made some changes , some times its affected in both A.xls & B.xls and some times it is not affected. Even thought the sheet was saved. How to refersh the excel sheet which displayed in the web page or is there ...

How to break links Excel 97
I have a spreadsheet that is showing I have 2 links. I have searched all of my worksheets and cannot find where these links are and I do not need the linked data. How do I just remove them? Sincerely, Jenna Hi use the following addin to find these links: goto: http://oaltd.co.uk/MVP/Default.htm and search for Findlink.zip (http://oaltd.co.uk/DLCount/DLCount.asp?file=FindLink.zip) "jwiley" wrote: > I have a spreadsheet that is showing I have 2 links. I have searched all of > my worksheets and cannot find where these links are and I do not need the > linked data....

link source data
I worked on employees data in excel version 2002, the worksheet contain lots of formulas, when i email the file to my supervisors, she get a message stating "This Workbook contains link to other data sources", i either to choose update or not to update icons, what ever i choose, the cells that contain fomulas switch to #Name or #Value. please help me asap what is the problem, i tried many times to solve it but i gave up. please let me know One way would be to open a new spreadsheet, select the whole employee data worksheet, copy, go to the new spreadsheet, paste special, valu...

PLS HELP~! Simple Question: Master & Child Link without subform
Good day everyone. I appreciate any suggestion by all of you. 1st Is possible have Master & Child Link function without adding any subform? If yes, how? Eg: When I selected a customer "ABC Inc" from a combolist (or many more than 1 field; eg this month,sales man A and etc), all transaction record from table tbltransaction will show me all transactions in a ~*SPLITFORM*~ according what i selected, when I adding new record in the form the table tbltransaction will automatic adding new record including all selection(customer ABC Inc,sales man A and etc) I make whi...

Unusual situation regarding links updating
Has anyone ever experienced a situation where internal links (same workbook, one worksheet to the next) do not update automatically? We have a large workbook with over 50 worksheets. No complicated formulas. Tools/Options/Calculation is set to automatic. No external links exist. However, cells with linked data are not updating automatically. Update occurs when a cell is "opened" for edit and then closed. Only the cell that was opended is updated. All other cells fail to update. Seems kind of buggy. ...

Edit Links to Files Powerpoint 2007
I have a couple of Powerpoint presentations with graphs where the data is linked to an Excel spreadsheet. At one point when I opened the presentation I received a message (Microsoft Office Powerpoint Security Notice) asking if I want to update the links. Now however, not only do I not receive the message allowing me to update the links, but the Edit Links to files option has disappeared from my Office menu. I can update the graphs by opening each one individually (if the Excel file is open) but I have a few hundred slide to update on a regular basis and would like to have it auto...

How do I make a checkbox bigger?
I am using a checkbox in Excel. I can control the font size, but cannot seem to find a way to actually make the checkbox itself bigger DMD, If you're using the checkbox from the Forms Controls Toolbar, select the checkbox and then right-click on your mouse. "Handles" should appear on the exterior of the checkbox. Select the handles and resize the checkbox. If you're using the checkbox from the Control Toolbar, make sure that you have activated the design mode. ---- Regards, John Mansfield http://www.pdbook.com "DMD" wrote: > I am using a checkbox in E...

Ressource Name for External Link
Dear All, When connecting a user and going to his project on PWA, Ressources names appear. However, if the link is an external to another project, the name of the External Ressource name does not appear. Does anyone know how to solve this problem? Thanks yann -- This is not a bug in the software. External links only include a small amount of information, and does not include the resources assigned to the external task. Furthermore, there is no way to force the external task to display resource names, but perhaps you could write custom code in VBA to extract this informa...

Updating the link state table
Is there a button in Exchange System Manager anywhere (or a utility) to get Exchange to review the link state table (eg is a connection to another server up down) and recalculate best paths etc? I'm interested particularly because I find the "deny public folder referral" checkbox on a connector takes hours to be honoured and, without restarting the server, I'd like to be able to 'prod' Exchange to notice the change. Thanks No time to test it for PF referral, but you can try this: Just restart the related SMTP virtual servers. You need to right click "Stop&...