I need to find a way to do conditional formatting and disabling of a cell based on a value from another cell. For instance if A1=X,Y, or Z, then B1 will get grayed out and cell entry will be disabled. This is so that when skimming over the sheet, you can tell what cells in row B you need to put info in still, and if it's grayed you'll know you don't have to put anything there (and it won't let you).
I have information in A1. I want A1 to look at B2:B5 and D2:D5 (Under conditional formatting) and if there is one or more "X" in those cells to color A1 Grey (Fill). I keep trying to put a formula under conditional formatting, but it is only working for the first cell (B2) and not the rest.
I have a userform with one combo box and one check box. Using the below script I am attempting to disable the check box as soon as a selection from the drop down option of the combobox is made. The combo box drop down menu starts with a blank. What I am finding is that even if the blank option is selected then this disables the checkbox prematurely. Ideally the checkbox should only disable if a non-blank option from the combo box drop down menu has been selected.
What I would like to have as end-result is that the blank option from the drop down menu in the combo box can also enable the check box again if a selection from the drop down menu has been chosen but then reverted again.
Code: Private Sub ComboBox1_Change() Select Case CheckBox1.Value Case True: ComboBox1.Enabled = True Case False: CheckBox1.Enabled = False End Select End Sub
I am using Excel 2002 and have had a couple of files that seem to have become corrupted recently. When I try to open the files there is nothing there, no cells just a grey space where the cells should be. When I try to close Excel it asks me if I want to save changes when no changes have been made.
I had not made any changes to the sheets prior to this happening so am struggling to work out what is going on.
Essentially, I'm creating a spreadsheet which contains a list of staff in rows, and the months of the year as columns. It is to record certain company checks which must be done (e.g. driving licence check). When a check is complete, the date it was done is entered under the corresponding month. Certain checks (e.g. driving license) only need to be done every 6 months. What I'm trying to do is find a formula/vba to look at each row, determine where (which month) the date was entered in, and grey out the 5 months in front, meaning the next check is required in 6 months time.
Ideally, the frequency of this check is dynamic, and can reference a cell (e.g. might change to every 3 months etc).
I am looking for a way to highlight groups of identical number cells in alternating grey and white. My goal is to make it clear when there is a repeating set of numbers. Below is an example of what a completed state of this would look like that I created manually. The real form I will be using this code on will have long number which is why I am looking for this added clarification. I am using excel 2010.
Is there a macro that will format unused rows or with no value in a given range. I have a sheet that I am using that some of the date is either added or deleted and would like to have a macro to do grey out unused rows. I am using this with a form control.
I am running into a seemingly random event upon executing a rather long program in Excel VBA: a square area turns gray in the left of the screen in Excel, making invisible everything under it, and affecting every sheet and workbook open. The only way to get rid of it, so far, has been to restart Excel. I thought it pertained to a faulty Office installation (XP/2002), but then it also happened on another machine (with Excel 2003) where I installed the application.
Is there a way using VBA that will allow me to disable a COM Add-in when I open a workbook without me (or the user) going through the steps to remove it first.
The reason for my asking is this: We have installed SAS Add-in 2.1 to Excel 2007. So this brings up SAS under the Add-Ins tab. But then when my program executes and it sees I use command bars, it adds my command bars under the SAS menu. I am trying to make the interface as clean as possible for the user, so they only see my command bars or menus.
Also, if we were to install the SAS Add-in 4.2 to Excel 2007, I have read in a SAS paper that SAS Add-in 4.2 creates its owe tab on the ribbon instead of inside the Add-in tab. So I would be able to use xml to make the SAS tab visible="false".
I am just using a simple sheet to keep track of email addresses. Every time I enter an email address it automatically creates it as a hyperlink/mailto function. So if I click on the cell, it will create a new email via outlook addressed to that person.
This is driving me nuts! I have a few thousand emails, mostly copied from other people's sheets, and 90% of them are set like this. Is there a fast way I can disable this function so that every cell is just text?
I'm working on a workbook that has alot of calculations in it, on a pretty slow PC (Work-related), so auto-calculate is casuing crashing, so what I've done with this sheet is disabled auto-calculate and added a macro to calculate each sheet indiviually instead, which avoids the crashing (The last sheet still takes a minute and a half to process but thats ok I guess).
My worry is, when this workbook does the rounds, peoples excel will already have autocalculate on, and will crash it themselves. Is there anyway I can ensure that the sheet turns atuocalculate on or, failing that, does anyone have any ideas on how to help the issue?
I have a UserForm with lots of controls divided by multiple frames. (163 controls over 19 frames). The same UserForm will be collecting multiple sets of data but the first set is a "master" set. Anything entered in the master set will auto fill in subsequent sets.
What I need is a way of preventing the user from changing any options that were input in the master set in subsequent sets. ie, If I entered info into Frame1 of the master set it would show up the next time I opened the UserForm (I have this part), but I would not be able to interact with it (this is what I need).
Since I'm already pre-populating subsequent sets with the master info, my first thought is to loop through each frame testing for input and if so setting Enabled = False, but I'm not sure how to do the loop/test. Is there a way to set up a "For Each Frame in UserForm" statement? Also, the controls in each Frame could be TextBox, OptionButton, and/or CheckBox. (sometimes more than one type in the same Frame)
I ran into a problem with one of my macros the other day. It processes several data files given to us each week. This week, one of the files had Auto-Filter enabled. I had to manually disable auto-filter, and re-run my macro.
I tried recording this action, but wasn't able to. Is there a way to disable/enable Auto-Filter with VB?
I have recorded a simple macro that refreshes a set of random data in my sheet everytime I click on the button I made. When I see a zero in one of the cells I know to stop refreshing. The thing is, I click on the button quite rapidly and sometimes miss the zero. I need to click on this button quite quickly so slowing down isnt an option! What I need is for excel to stop that button operation when it sees a zero in one of the cells.
I'm working with Excel 2000 on Windows XP machines. I have the following
Private Sub soInputBox_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer) If KeyCode = vbKeyReturn Then PushScreenUpdateState False clearAllData loadAllData Worksheets("Main Screen").Activate PopScreenUpdateState End If End Sub
Private Sub loadAllData() soInputBox.Enabled = False End Sub
The idea is this: the user can either type the value into the text box (soInputBox) and then click a button, or type the value into the box and then hit enter. They will both do the same thing; set in motion all the functions that load a bunch of data, etc.The code for the event handler for hitting enter is shown above. Inside of the loadAllData function, I disable the text box. What seems to be happening is that after the soInputBox_KeyDown function exits, Excel crashes. If I comment out the line to disable the text box, Excel doesn't crash. My question is this: is this a known problem, and is there a known workaround? I would like it so that the text box is disabled so that the value that was input cannot be changed accidentally during the rest of the programs execution, so if there's a way to change the control to be unmodifiable instead of disabling it that would be a reasonable alternative.