Validation code for macro to run

Hi...the code below works fine, but how do I change it so that it
doesn't look for a blank cell (""), but looks for specific text in a
cell?  There is an If formula in cell C269 so that if 2 figures balance
then this cell displays "TRUE", otherwise it displays "FALSE".

The code mustn't run if Cell C269 displays "FALSE".

If [C269] = "" Then
          MsgBox "The figures don't balance!!"
          Exit Sub
    End If
    Range("E1:E48").Select
    Selection.Copy
End Sub

Thanks.

Rob

0
robingSA (4)
12/9/2005 2:22:04 PM
excel.misc 78881 articles. 5 followers. Follow

1 Replies
405 Views

Similar Articles

[PageSpeed] 42

Rob, try this,

If [C269] = "False" Then
          MsgBox "The figures don't balance!!"
          Exit Sub
    End If
    Range("E1:E48").Select
    Selection.Copy
End Sub


-- 
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

<robingSA@gmail.com> wrote in message
news:1134138124.034515.106260@f14g2000cwb.googlegroups.com...
> Hi...the code below works fine, but how do I change it so that it
> doesn't look for a blank cell (""), but looks for specific text in a
> cell?  There is an If formula in cell C269 so that if 2 figures balance
> then this cell displays "TRUE", otherwise it displays "FALSE".
>
> The code mustn't run if Cell C269 displays "FALSE".
>
> If [C269] = "" Then
>           MsgBox "The figures don't balance!!"
>           Exit Sub
>     End If
>     Range("E1:E48").Select
>     Selection.Copy
> End Sub
>
> Thanks.
>
> Rob
>


0
12/9/2005 2:28:10 PM
Reply:

Similar Artilces:

CODING HELP 09-14-06
Hi I am trying to use the following code in the form save event. What i basically want to do is set the field called adding contacts to read only = true if contacts is not checked. Both these fields are checkboxes. Following is the code i am trying to use. Any advice would be really helpful please. var CRM_FORM_TYPE_CREATE = 1; var CRM_FORM_TYPE_UPDATE = 2; switch (crmForm.FormType) { case CRM_FORM_TYPE_CREATE: if crmForm.all.new_contacts. = 0 crmForm.all.new_contactsadding.readOnly = true else crmForm.all.new_contactsadding.readOnly = false break; case ...

Formulae, conditional formatting & macro security
I've used conditional formatting based on a simple formula like =$B6=1. Now Excel warns me of macro viruses and I have to choose whether or not to enable macros before opening this spreadsheet. I'm pretty sure this formula is the cause because I've tested it in a spreadsheet that contains nothing else except the two cells under test (B6 and the cell I'm formatting). If I change the formula to a constant and use "cell value is" then the macro warning goes away. I certainly haven't created any macros in the workbook and if there were any presumably the warning woul...

Still need help with a code reference problem
I have a problem (in fact several) with a workbook. Under certain conditions (absolutely reproducable) the sheet seems to reference a code block that does not exist - I have a pic of the window that appears here; http://www.jimsthings.com/excel/Fill_Rota.png the workbook that produces the error is here; http://www.jimsthings.com/excel/8_test.xls the sheet affected is the open sheet (Timesheet) - if I click on any of the cells A:44 to A:60 (approx) I get the error window shown in the picture above. Several people have helped by saying that this seems to be at least part...

report definition not valid
Good Afternoon. I have been getting this error recently. "The report definition is not valid. Details: The report definition element 'ConnectionProperties' is empty" Every time I make changes to the report and save it, an incomplete ConnectionProperties element is added back to the rdl as follows: <ConnectionProperties> <ConnectString /> <IntegratedSecurity>true</IntegratedSecurity> </ConnectionProperties> If I remove this element and run the report, it works again until I make another change to the re...

Personal Macro Wook book will not open
Has any one ever come across this? when I try to record a new macro, I get the following message "Personal Macro Workbook in startup folder must stay open for recording" I have uninstalled and reinstalled but I still get the same message. what am I doing wrong? Help Thanks xl2002 or xl2003?? Those versions have the abililty to quarantine what it thinks are bad workbooks. They can keep track of them so that it doesn't even try to open them. If you look under Help|About MS Excel, you'll see a button called: "Disabled Items...". Check under there to see...

text box running off the end of the page
When I use a text box I am losing the end when it runs of the page. How do I set word so that the text boxes cary over to the subsiquent pages. -- Regards Dave Objects (including text boxes cannot span pages. ) Either use another text box, a table or put the text in the main document area. -- <>>< ><<> ><<> <>>< ><<> <>>< <>><<> Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org <>>< ><<> ><<> <>>< ...

Syntax error in MFC source code!
Hi, This is not a critical problem as the error is located in an unused private macro but MFC team might want to fix the problem neverthless. Version: VC++.NET 2003 File:fixalloc.h // IMPLEMENT_FIXED_ALLOC_NOSYNC -- used in class implementation file #define IMPLEMENT_FIXED_ALLOC_NOSYNC(class_nbame, block_size) \ CFixedAllocNoSync class_name::s_alloc(sizeof(class_name), block_size) \ The macro parameter should be class_name instead of class_nbame! For those wondering what could be doing the CFixedAlloc class, I wrote an article on this class that you can read on my site. Greetings, Olivie...

Word 2007 and Macro; Help needed
I have this macro that prints an address onto an envelope that I have selected in a letter. It doesn't work because the macro is printing only the first line of the address. In the example below, it prints "Collection Department" instead of the entire address which is: Collections Department Bruneel Tire Factory 5304 Chinden Blvd Boise, ID 83714 How can I make it work. I really need this macro. Thanks. John King jking482@q.com Sub Macro1() ' ' Macro1 Macro ' ActivePrinter = "HP Officejet 7400 series" ActiveDocument.Envelo...

Showing bar codes
I've made plane reservations with Delta. They sent me a receipt with a bar code that references my reservation. When I receive the email in Outlook 2007, the bar code doesn't show up--it shows that square that means the graphic failed, even after I right click to download pictures and also say Delta is safe to show pictures. However, if I pick up the email on Earthlink's web mail, the bar code shows up fine and I can print it. Is there somew way I can get the bar code in Outlook? Do you mean it shows a red x? Read here: http://www.slipstick.com/problems/redx.asp ...

Files open only when excel is already running
Hi there! I have the following situation: At work, I had an NT box with Office 2000 Pro. Then they gave me a new box with winXP and OfficeXP (and winfax standalone). Problem: When I double click on an excel file, excel opens, but the file does not open (blank excel screen). If excel is already open (without any files open) and then I double click on an excel file (or use the file-open menu), then the file opens just fine. Same situation if I try to open and excel file I have received as attachment in outlook. Any hints? Thanks, Stratos See answer in misc - and please don't multipos...

Forcing Visual Studio to validate XML against a schema
When I have an XML document in my project how can I force it to use a particular schema (i.e. and enable intellisense) for the document. The project is in source safe so I need a solution that works for every developer that opens the document. Thanks. --Buddy "Buddy Ackerman" <buddy_N0SPAM@buddyackerman.com> wrote in message news:uuQl%236JHGHA.3944@tk2msftngp13.phx.gbl... > When I have an XML document in my project how can I force it to use a > particular schema (i.e. and enable intellisense) for the document. The > project is in source safe so I need a solut...

How can I lock worksheets while still allowing macros to operate?
If you protect your sheet in code, you can allow your code to do things that users can't. Option Explicit Sub auto_open() With Worksheets("Sheet99") .Protect Password:="Hi", userinterfaceonly:=True End With End Sub It needs to be reset each time you open the workbook. (excel doesn't remember it after closing the workbook. That's why I used auto_open/workbook_open.) But there are still a few things that won't work as code. If you run into that, you could always unprotect the worksheet, run your stuff, and reprotect the workshee...

Running an excel file with macros in browser.
I have an excel file sitting on the server that users on the intra net access through the browser. Once the user has run the macros and closes all windows, EXCEL.EXE still shows up in the task manager. If you close it, it will ask if you want to save changes to the file. Does anyone know what causes this and how to fix this? Are you running XL through automation? If so, it is your responsibility to close (save, if necessary) any workbooks, quit XL and set the automation variable to nothing. If you are doing that, then, sometimes this happens because there are unqualified referenc...

Setup Assistant Crashes on Main User Account, Runs Fine on Other Accounts
Microsoft Error Reporting log version: 2.0 Error Signature: Exception: EXC_BAD_ACCESS Date/Time: 2008-04-01 12:14:43 -0700 Application Name: Microsoft Office Setup Assistant Application Bundle ID: com.microsoft.setupassistant Application Signature: MosA Application Version: 12.0.0.071130 Crashed Module Name: EntourageLegacy Crashed Module Version: unknown Crashed Module Offset: 0x000e921f Blame Module Name: EntourageLegacy Blame Module Version: unknown Blame Module Offset: 0x000e921f Application LCID: 1033 Extra app info: Reg=English Loc=0x0409 I'm running 10.4.11 on a macbook. I was ru...

Macro keyboard shortcuts in Visio 2000
The subject pretty much says it all: does anyone know if it's possible to assign a keyboard shortcut to a macro in Visio 2000? TIA, Dan. ...

VBA code to fax from Excel or Outlook
Hello, I've created a SBS 2003 environment. The domain, servers and all are up and running. Great. I've added a fax modem to the server. I can send faxes from my desk by printing to the fax modem. However, the boss says this procedure to fax is too complicated for his employees. He wants me to code it into an Excel application using VBA to fax out pdf files. I've looked and don't see how in an SBS 2003 environment to send faxes from the employee desks using VBA. I'm not sure if this is the right forum, but I need this like last week. I'm ...

Creating a macros to copy and paste cells
I have been trying to figure out a macros that will change a spreadsheet from a horizontal format to the proper vertical one (my labels are located in the first COLUMN, instead of the first ROW, with all of the data being located in the rows to the right). "Offset" seems to be a neccessary part of this macro, but I don't have a clue how to make it work. I had another worksheet, where I individually copied and pasted the address into their own set of rows (For example: A1:A7 contained the name, address, website, etc for one customer). My macros was supposed to copy and pa...

Conditionally inserting blank rows using macro
I have a workbook containing the results from an archery competition, (the data in there is just to make sure that it is working fine, I will delete it once it is fully functioning), and I need some help with the code. I have found one problem when i come to format the team results page for presentational reasons. As was pointed out to me, there can be situations when there is not enough members to constitute a full team, (in fact we had this problem only Sunday.) A macro for generating the team results was given to me, but when there are less than four members in a team, it immediately move...

Macro to expand formulas to additional rows
I'm working with a large multi-sheet workbook and need to expand the formulas on many sheets from Row 2 to a variable number of rows. Can someone offer vba code that will allow me to prompt for the variable and then expand the formulas to the specific number of rows accordingly? I'm trying to keep my spreadsheet lean and don't want to have 750 rows of formulas sitting there mostly unused. Sometimes, I'll only have 5 rows of data and other times 750. My knowledge of vba is second grade so any documentation in the code itself indicating what's going on is most encou...

Area/ZIP codes
MS requires that we enter a zip code when Office is installed... I've moved since installation and need Outlook to change the default area code for contacts to my new area code. How do i change this? "Dave" <dhoffa1@mymail.indstate.edu> wrote in message news:0b8c01c3615c$01e1da10$a101280a@phx.gbl > MS requires that we enter a zip code when Office is > installed... I've moved since installation and need > Outlook to change the default area code for contacts to > my new area code. How do i change this? First it was zipcode (for postal mail). Then it wa...

"cannot run this process while invoices are posting" error
I'm running year end close for inventory, ie remove discontinuted items and update standard costs. We tested the process in our test company and had absolutely no problems. Our test is an exact replica of our actual database. When we tried the run the process in our actual company, we got the error "cannot run this process while invoices are posting." We aren't posting anything and all users, except the actual driver, are logged out. Any ideas where to start? just to make sure that everything is clear, run the following delete statements in SQL Query Analyzer DYNAMIC...

How long should Inbox Repair run ?
I am running the Inbox Repair tool against a 570mb .pst file and it is currently in the "repair" process. Based on the siz of the file, how long should this run ? Size does not matter - number of errors found does. It can take up to an hour or more depending. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert latest virus name here) virus, all mail sent to my personal account will be deleted without reading. After searching google.groups.com and finding no answer, jadakid asked: | I am running the Inbox Repair to...

Running two different Great Plains Client installs on Terminal Server?
We have two companies using the same Great Plains database and the client side requires different modifications in each company. Our thought was to create and maintain two different client installs for each company to keep the customizations separate. Does anyone have experience doing this on Terminal Server? What type of modifications? Forms,Reports? If that is it then just create a different Launch path and create a shortcut for the new launch and point the Dynamics.set files to the modified forms or reports for that particular company. >-----Original Message----- >We have...

Drop Down Data Validation List
Ready to jump out the window. I have a data validation list which I'm using for 10 columns (C5, L5, U5, etc.) within a worksheet. The validation list contains 8 #'s, however I'm treating them like text; otherwise if 00 is in front of a number, it wants to remove the two zeros (i.e. 00609 would read 609). This drop down list is working fine (I can choose 1 number of the 8 each time); however, on another worksheet within the same workbook I'm trying to display what single # is in each column (C5, L5, U5, etc.) Every formula I use gives me #VALUE or some other error m...

Problem with MSCRMWorkflowService ERRO Code: 16649
Hi, I=B4m having a serious problem with the MSCRMWorkflowService Condition {25F79661-6989-DB11-9B99-0002557CCD69} failed in step {1BF79661-6989-DB11-9B99-0002557CCD69} of process instance {90F69661-6989-DB11-9B99-0002557CCD69}. Please view the paused rule in the Microsoft.Crm.Workflow.Monitor for more information about the failure. It=B4s really strange, because the WorkFlow Monitor doesn=B4t show nothing in pause... and some workflows work well, but something are really strange in here!!! Any body can help me ?? I'm not sure exactly what to tell you but I just got done working on an...