I have minimal excel knowledge, but enough to get by. I have 2 years in C++ programming.
Here's what I'm trying to do:
I'm trying to create a workbook to keep track of flags we send out, and receive back. We have a lot going and coming, so I figured the best way to do this would be to break down each region on different sheets. But I need to create a check box that says something like, "Yes/No" or "Here/Gone" or something like that. THEN, I need to take that information, and put it on the front sheet of the workbook so I know how many we have in/out total. Does this make sense? I know how I would program this in C++, but excel is a bit different.
I have a timecard spreadsheet which im working on, each employee is represented by a single worksheet in the workbook, and the worksheet is named after the employees name. New employees are added by filling in a form which dynamically creates the timecard based on a template. Im trying to impliment a 'Fire Employee' button which sits on each employees sheet and can be clicked to set an employees working status to false by changing a boolean variable called 'fired' to true.
Ive been looking around the forum but I cant figure out if i should be using public variables or where exactly i should be placing them, so that each employees 'fired' status is set to false when the worksheet is first created, but can be set to true when the 'Fire Employee' button is clicked, this must only set true for that specific employee, and not all employees. If your wondering why i need this, the employees work status will be used on other forms to toggle views etc so thats why a boolean approach is best (at least i think it is if its not to difficult to do)
once bTest is declared as a Boolean, it becomes equal to FALSE (I checked this after much head scratching). How does one assign a value to a boolean variable only after you make your test.
Sub foo()
Dim bTest As Boolean
If Range("a20").Value = False Then bTest = False '
I need help creating a code that does the following:
I want a Boolean variable (TheTD) to be True when and only when the value in cell A1 is "TwoOnly". Once it isn't then I want the Boolean to be immediately False. Once cell A1 is "TwoOnly" I want TheTD to be true immediately as well.
I am using a userform and the textbox1_Change macro can change the value of cell A1 while typing. So in other words The Boolean can be changed from True to False multiple times depending on what I type in textbox1.
I would like to construct in VBA "n choose r" Boolean arrays of length n which will give all possible combinations of these variables as you scroll through the arrays.
Typical values of n and r would be 40 and 5 respectively and I'm looking to get the fastest possible output on these 660,000 or so arrays.
I have been playing around with various "for, to" statements but haven't managed to turn out anything meaningful thus far.
I have cells in my Excel sheet that contains boolean values, ie. the values TRUE or FALSE. Is it possible to format these cells so that FALSE is written with red color?
Seems like this one should be pretty easy but I'm stuck... I just want to return a boolean based on whether the currently active cell contains the character "#". I've been trying to use the find method but I can't figure out how to convert a match or lack of a match to a boolean.
I have strings in cell a1. I will put a formula in a3 if string "xyz" is found inside a1, it will show value from a2, else shows nothing.
i tried simple formula cell a3 =if(a1="xyz",a2,"") here it is exact match, i need partial match, or multiple partial match in a single cell. How to do it?
I want a boolean function to return whether the PC is connected to the Internet. How to start creating this.
Reason:
I have code that checks an online database and downloads data after the user presses a button.If the host computer is not currently connected to the net, I would like to display a message of my choice instead of trying to run the code.To determine whether to run my message or not, I need a function that will return TRUE/FALSE if the host PC is net connected or not.
i need someone that can think through this boolean logically. its been a long day at work and now I'm trying to walk through this boolean thing to make sure my data will post on the right pages.
I have an Excel Macro that will capture inputted customer/vehicle data from an input screen, at the end, based on questions answered, i need to place that data on 1 of 4 sheets in my excel document.
The questions are: Is this a Nationwide claim? (Y.N) (boolean = nw) Is the vehicle here? (Y/N) (boolean = vh)
So here's what i got if NW = true and VH = True then place data on "sheet1" if NW = true and VH = False then place data on "Sheet2" if NW = False and VH = true then place data on "sheet 3" if NW = false and VH = False then place data on "sheet4"
I can't think of how to write this IF statement for this to happen. can't get the logic going.
I'm trying to figure out how to reorganize data based on boolean values in two different columns. My goal is to write something in VBA that will look to see if the boolean in the first cloumn is true then procede to check if the boolean in the next column, same row is true. If that is the case, it will take several values from the row and move them to another worksheet. If the boolean in the first column is true, but the second column is not, it will look down the rows of the second column until it finds true then move several values from rows it has passed through. Here is an example of the sample data I will be dealing with.
Date Time Duration Boolean1 Boolean2 6/22/200715:0032TRUETRUE 6/22/200718:0058TRUEFALSE 6/22/200719:0060FALSEFALSE 6/22/200720:0060FALSEFALSE 6/22/200721:0060FALSEFALSE 6/22/200722:0060FALSEFALSE 6/22/200723:001 FALSETRUE
Based on the example data my goal is to move the data in a new worksheet that would look something like this
Date Start End Duration 6/22/2007 15:28 16:00 32 6/22/2007 18:02 23:01 299
This macro adds a comment to a cell and some text from an input box. I store the last value entered in the input box via the registry, it is recalled as the default input box value. How do I capture the cancel property (Boolean, true or false?) so the ActiveCell.Value remains and comment is not added? When a user selects Cancel/X the macro deletes the value in the cell and add's a comment. This overwrites existing data with "" (nothing).
I am attempting to pass a boolean variable between two macros. The SUBMIT macro calls the STATUS macro to do some verifications and the STATUS macro should return the boolean variable RDY back to the SUBMIT macro, but does not.
I am using Excel 2007. Both macros are in the same Module. The STATUS macro is called from several places in the code.
Public Rdy As Boolean Sub Submit() [code] Call Status If Rdy=True then msgbox("You have completed your form") else msgbox ("Not ready") [code] end sub
Can I use dates as argument in Boolean arithmetic? I have a list of name with their date of birth and I would like to tell who is between 18 and 25. It's easy enough with number but with dates? Excel 2007
I have a function that works well for checking if a specified file exist within a specified path. I realized I do not know how to just check if the folder exist!
Example: I want to see if the following folder exist with boolean response...
OK, so I have a userform with some text boxes that I have specially formatted to accept only date values in the form of mm/dd/yy. By default they are blank. I have a check in one of my codes that looks like this
Code: If DateBox vbNullString And DateValue(DateBox) > checkdate Then M1 = "NEOPRENE" & Chr(13) Else M1 = "" & Chr(13) End If
Where DateBox is this specially formatted TextBox and checkdate is a future date being checked against.So if DateBox has a value in it AND that value is greater than the date being checked against the returend string is Neoprene, otherwise it is blank.
Well the problem I have is when the first condition returns FALSE, i.e. when DateBox is empty, the DateValue half still gets evaluated and returns a type missmatch error or something like that because DateValue("") returns an error. I have line of code 8 times, one for Neoprene, squeegee, etc. So the name of the text boxes are each unique and I am using M1, M2, M3, etc.
For other reasons, use of "On Error Resume Next" doesn't work for this situation because it causes a result opposite to what I want to happen.
I'm trying to enter "True" in a cell without it being interpreted by Excel as a boolean value. Initially it was entered through VBA, but I've found I cannot type it in without Excel capitalizing and centering it.
So far, I've tried formatting it as Text and General.
I am using the following code to put a combo box in my userform. When I try to run it I get the following Compile Error: For without next. What does it mean and how do I fix it?
just make some files to make my work easier. Few too many watching the game last night, and I think im lost here. Am I attempting to do too much here ? I ran the first For statement Fine, but I cant get the second to work. I dont understand where my next statement should be entered.
I have information on 7 seperate sheets in a workbook and need to bring the information from each individual sheet and compile on one sheet. I know this is simple and I'm making it a lot more complicated then it needs to be...
I need to compile a list of all worksheets except Data, Attempted Calls, Completed Calls, Completed MOU, Incomplete Calls, Percent Complete, Busy Calls, and Percent Busy. I need to put this list in B4
Then I need cells in C, D, etc to reference the value in B as the target worksheet.
All worksheets are formatted exactly the same, except the ones above.
Have tried a few things but can't get it to work properly. I have attached the file I am working with because it is much easier to understand if you just look at it!
Basically, I have a single sheet with three columns:
Name, Post Code, Tenant
There are varying instances of 'Name' and each one has a different 'Tenant'.
What I need to do is merge the contents of the Tenants cells so that for each different 'Name' there is only 1 instance and then for Tenants all the different cells are merged i.e. "Tenant 1, Tenant2, Tenant3...etc"
I hope this makes sense, as I mentioned above it will be a lot clearer if you have a quick look at the attached spreadsheet.