This very simple color code below worked before but now it gives "Application-defined or object-defined error". When I try it on a new workbook, it works fine.
Code:
Sub sdsdfsd()
Selection.Interior.Color = 65535
End Sub
I am trying to a macro that allows me to change the backgroud color and font color depending of the value of the cell.
For example is cell A1 is having the value between 1 to 3 the background color of the cell will the light turqoise, if the value is between 4 to 20 the cell background color will be green and so on.
I have based on certain posted example and adapt to my code but somehow it is not working.
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Count > 1 Then Exit Sub Select Case Target.Value Case Is = 1, 2, 3 Target.Interior.ColorIndex = 34 Case Is = 4, 5, 10, 20 Target.Interior.ColorIndex = 43 Case Is = 30, 40, 50
I searched through the files and found a macro that works for me to color code my spreadsheets in Excle. Hwoever. How can I set it to stop when Cloumn G = the word "Created"?
Sub prettyPattern2() Dim lRow As Range For Each lRow In Range("A6:K500").Rows Select Case lRow.Row Mod 2 Case Is = 1: lRow.Interior.ColorIndex = 34 Case Else: lRow.Interior.ColorIndex = 35 End Select Next lRow End Sub
Here is my simple Private Sub that I can't get to work,
Private Sub Worksheet_Change(ByVal Target As Range) Dim c As Range For Each c In Target
[Code]....
I have a checkbox control that changes the value to "True" or "False" in column 4. Here lies the issue, if I use the check box control to change the value, the private sub does not work. If i type the value of "True" or "False" where the check box control stores its value, the private sub works. I would like to see if there is way to get the private sub to work by simply clicking on the check box control only.
I have a spreadsheet that will contain about 5-15 rows with a letter "S" in the column. If this letter S appears in the column, I need its entire row to change font color to RED and then change that row's value in column L to a negative number. is there any easy way to do this?
I'm currently using a vba script to unprotect all of my worksheets within my workbook in order to refresh the pivots and then protect them again once the pivots are completed, but there are two worksheets I would like to remain unprotected in order for users to be able to edit them after the pivots have been refreshed. Now I've tried adding a sub code in order to unprotect one of the sheets as a test to see if it will allow me to edit the worksheet after I update the pivots. Unfortunately the coding isn't working, and the worksheet is still remaining in protect mode. Here's the code I am using to protect the worksheets when refreshing the pivot as well as the code I am attempting to use in order to unprotect the one worksheet.
I have used the below code to make hide/unhide some columns in my excel sheet. It works fine. Now, I need to protrect the sheet except the coloured cells. So I unlocked the cell by clicking the property of the colored cells & then did this :- tools- protection-Protect sheet - protect unlocked cells. But after protecting this sheet the macro code of hiding/unhiding of the columns are NOT WORKING & Errors is coming. I have used the below code:-
I want to color the cells for some specific texts in RED, and some in BLUE and some in GREEN.
For Eg: I want to color the cells in RED, which contains below specific texts in a sheet. UNIX LINUX MS OFFICE POWER POINT....like this for nearly 100 specific texts.
and I want to color the cells in BLUE, which contains below texts in a sheet. JAVA .NET SQL MSDOS....like this for nearly 100 more specific texts.
If i create a rule in conditional formatting for each text,I have to create nearly 400+ rules for my task now, which is not possible.
I recorded a Macro to open a specific sheet and it works fine however I want to go to the next step and have the sheet open to a specified column in the sheet based on the column in cell 'H2' on the current sheet.
I usually create fairly simple macros using 'button' feature. However, now I'm using the 'CommandButton', as I had to make buttons highlighted once selected - So I have a choice of five options, whichever the user chooses that option background changes, the others stay grey...anyway, thats the fancy-editing done, but now when i enter a simple instruction - hide rows function - I get the error message "Select method of range class failed"
Here is the full code - like i say it works fine when its just the editing, but when i try to actually hide rows it doesn't work. - I will also add that the code is inside 'Microsoft Excel Objects' and further 'Sheet 1 (INDEX)' - not a module - I'm not sure if this is important.
Had a bit of code I was working on for a guy on here, and came across a problem while putting the finishing touches on it. It's since been solved by someone else, but for future reference...
1. By entering a numerical value in Cell A1 for example typing 5. 2. Then, next five columns would be blocked with specific color. 3. if i am typing 10, then 10 columns would be blocked with specific color.
how to create a barcode in an excel spreadsheet? I am trying to print out a sheet that includes a code 128 barcode of a specific number that I type in.
I really don't know how to code a checkbox correctly. On the sheet, I have a form with CheckBox1 and Checkbox2. I would like Checkbox2 disabled until Checkbox1 is checked. Also, when Checkbox1 is checked, display Image1, otherwise Image1 is hidden. When CheckBox2 is enabled and checked, display Image2, otherwise Image2 is hidden. I know this is real beginner stuff, I'm still a rookie.
I have a rather large workbook (30 sheets, 10MB) that has one worksheet with many INDIRECT functions in it (pulling data from the same file, different tabs). I am working to put simple code into the workbook to protect and/or unprotect all worksheets. I have gotten code to work to both protect and unprotect all the sheets, but when I run the unprotect code (see below), and then I go to edit the workbook, data from the sheet with many "indirect" functions temporarily "overwrites" the data on the active sheet (this is fixed when I scroll my mouse over the effected cells). I am developing this workbook for other users, so I'd like to fix this before sending it off to them.
This problem does not happen until after I run the following .....
I asked for a macro to delete the whole row if a duplicate customer number was found in column B. Sometimes, though, my column numbers change. So, logically thinking, I simply changed the criteria, but the macro ONLY seems to work if duplicate customer numbers are in column B only.
This code below won't work if the Customer Number is in column D instead of B even if the reference of B:B is changed to D:D, it doesn't carry the macro over.?
The job cost controller is not exactly what I need, so I have been trying to create my own. So far my progress has got me to be able to separate each laborer for each job.
Here is my query: I have a drop down menu that lists ten different tasks(i.e. carpentry, painting, demo, etc.) and I want each of the ten tasks to separate themselves. Is this a vlookup function? How do I make excel listen?
I have previously used the following code to successfully pull out IE webpage source code for string manipulation.
Its a crude example to demonstrate the principle:
Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Public IE As Object Sub Sample() Set IE = CreateObject("InternetExplorer.Application") IE.Visible = True
[Code] ......
However when I substitute in a Google websites address into the IE.Navigate command, the code runs to the "Source_Code = IE.document ...." line then flags up a Microsoft Visual Basic error. "Run-time error '438': Object doesn't support this property or method"
The webpage that I am trying to access is a confidential company site, so you won't be able to access it yourself, but starts with [URL] ......
The one thing that I have noticed about this website is the Privacy Report icon in the lower right status window (Picture of an eye with a restricted symbol in front). I don't know whether this is the cause of my problem, or purely an incidental observation.
Is there something peculiar with Google sites that means that the source code cannot be extracted in general, or is this an issue specific to my site ? Does the Privacy Report icon have any relevance, and if so how do I switch that off ?
I have a named range on one sheet, and I want to show this as a reference on other sheets. I thought this would be simple, but maybe it's just not the way named ranges are used.
Attached is a sample spreadsheet. First tab shows the table defined; in practice it would be much larger. Second tab shows how I want it to appear. I see that I can do this by copying each cell reference. But what would be nice is to simply say "Put the named range block of cells right here."
Essentially I'm in charge of managing schedule for 5 students, I would like to get them to meet during their free time (free for all 5 of them)
1. Schedule has to run from 8 am to 9 pm. 2. I have all 5 individual schedules.
I want to combine all 5 into one so everyone can see their free/occupied times, it would be extra useful if I can modify individual schedules (One student's work schedule changes bi weekly).
It has to be able to show who is occupied at which time and free time for all of them. (color coding each of them would be amazing also, granted I can show multiple clashes with gradient or something similar)
I understand it involved creating individual spreadsheets and a master sheet but how to go on about it.
I have this code (not sure from which thread) which can export my worksheet with specific file name & folder (according to date and part type). I tried to put it in my worksheet but it's not working.
[Code]....
and it's highlighted at following part
[Code] ....
I received this error from the message box : Run-time error '1004'
Document not saved. The document may be open,or an error may have been encountered when saving.
I've put together a spreadsheet look at the time taken for a vehicle to get from one building to another when called. I've set up conditional formats where the timings turn orange after 5 minutes and red after 10 minutes taken. What I also have to show though is who is taking the vehicle and break it down to show any delays to patients. Is there a formula that will automatically tell me when there has been a delay to patients?? Be amazing if there is as it would save me uber amounts of time as i have to collate a whole years worth of data!
I've attached a small sample of what I've done to show you how the spreadsheet looks.
I have a workbook used for scheduling purposes and you can add hours to it by typing in D+1 or D-1, etc. I want to prevent this from working and just ignore the cell if the cell contents say "DC". I've tried to adjust my formula but haven't had any luck. I've attached an example worksheet with the formula for an easier understanding.
Basically in my sheet I have a table of various data, where an entrant can appear more than once. e.g.
ACBDC AABDC DBCCD BCDAB
I want to make it so that if you type in an input cell (say cell G10) an entrant your interest in (i.e. A, B, C or D), then the corresponding entrants in the table will change font color to red and go bold.
I know this must be done by right clicking on the sheet and entering a code in "View code". I can't use conditional formatting because I've already used up all 3 conditions!