I have a simple spreadsheet. A column for a persons name and 31 columns, one for each day of the month. I want to apply conditional formatting, either fill color or border color, to the date column of the current date when the spreadsheet is opened.
I'm trying to have a macro run to search a specific column (S) for a particular text value "y" and if true it will change the font to bold and the color to red for the entire row of the cell that contains the "y". the column is part of a data table that is constantly refreshed not sure if that makes a difference or not.
I have taken over this spreadsheet for my work, and it is basically a statement in excel. What I want to do is find a list of invoice numbers in column B populated from a remittance, and then replace column F to say a specific thing depending on check number and date paying for that invoice. So if a check printed today I would have it replace column f to say paid 1/31/13 check # xxxxx. Currently I am searching for each invoice indivudually and then replacing with check number and date. There are about 200 invoices per month that I deal with, and it is a big waste of time!
I am trying to come up with a macro that will find rows that contain the words �as % of Revenue� and then calculate and apply the appropriate formula to the actual and budget columns. I have attached a sample of what the source data look like.
The formula divides the category�s total expense by the revenue in row 4. For a complete macro, I would want to also subtract the budget result from the actual result and put its result in the �better (worse)� column. I need to use this on 12 or so different workbooks which is why I�m wanting a macro.
Here is my attempt to accomplish this task; however, I quickly realized it is woefully inadequate because I neither understand how to apply it to the different columns or how to find the next instance of �as % of revenue�).
VB: Sub Macro1() ' ' Macro1 Macro ' Range("B10").Select Cells.Find(What:="as % of Revenue").Activate Range("B20").Select ActiveCell.FormulaR1C1 = "=R[-1]C/R10C" Range("B21").Select End Sub
I'm trying to add a textbox at the current position (selected cell) with a set size, fill color, and border color. I found this: http://msdn.microsoft.com/en-us/libr...8(VS.80).aspx:
I have a macro that changes the color on a row, but depending on which cell I am in different columns arwe changing color. What I want is that if I make a change in row 1 want the color in A1:L1 to change and if i change row 2 i want A2:L2 to change, so alwaws the columns A to L in respective row. My macro
Sub Markera_Ny() Dim intRadnr As Integer Dim intStartrad As Integer Dim intSlutrad As Integer Dim Box As Integer Dim Rad As Integer intRadnr = ActiveCell.Row intStartrad = ActiveSheet.Range("First").Row intSlutrad = ActiveSheet.Range("Last").Row If intRadnr < intStartrad Or intRadnr >= intSlutrad Then MsgBox "Macro can only be executed in rows 21 to 1000" Exit Sub End If....................
I know how to set a conditional for a cell to change a color when i apply a specific value, but how about if i want to set E2 cell to change to green when i place a 'X' on F2?
Pretty much I want 2 columns that say Yes and the Other No. When i place a X on Yes that other cell turns green, if i place a X on No that other cell turns red.
My boss wants a spreadsheet that has multiple buttons on it that will change the background color of a specific cell to four different colors. Example:
Text written in Cell B3, Button in Cell A3 that will change the Background color of Cell B3 to either Green, Yellow, Red or Blue.
There will be a lot of buttons on this worksheet following the same format as above. I don't want to change the value of what is in the cell, just the background color.
I have three columns. Column 1: A list of items with a very long text description in each cell Column 2: The Key phrase found within the long description in the cells of Column 1. (The key phrase is different for each cell). Column 3: Custom shortened description in text format. Column 4: Formula to return the Custom shortened description, equivalent to the item in Column 1
How do I create a formula in Column 4 so that Excel searches for the Key phrase found within the string of Column 1 and returns the custom description in Column 4?
I am trying to write a code for VBA code for find and replace, I want to find a particular phrase (i.e. 1. Value Added Processing) which is all in one cell and replace it a range of cells of other cells which is contained on a different sheet.
So basically the original 1 cell would be replaced for anywhere between 1 to 20cells. Depending upon what I type in.
I need to conduct keyword searches in excel and color the keywords a different color without changing the font color of the entire cell. now, i found some code from another thread that does this, but i cant seem to get it to work with more than 2 keywords. i need fine-tuning the provided code to do what i need it to do.
[URL]
the VBA code i used was this:
[Code].....
I was playing around with the example, the Cat_Mouse.xlsm, and when i modified the 'myList' and 'myColor' arrays, it does not work.
Cat_Mouse.xlsm
For example, I modified the code to add the word bat:
[Code] .....
When i run the macros, the word "Bat" does not become colored red. interestingly enough, when i substitute the word "bat" for the word "hat" in the "myLIST array, the word "hat" does change to the red font.
I am looking to use this code to address keywords in my excel file by coloring all key words red and i have more than 10 key words.
I have used the below code to insert a new row when the value in coulmn A change. I now need to evolve it so that the new row will contain a specific value depending on the changing value:
Before: Column A Column B one test one test two test two test three test three test
After:
Column A Column B one test one test Coz two............................
part of my code looks like this. Instead of it being if c.interior.colorindex i want it to be if top border color = 4.
How do i syntax this?
For Each c In Worksheets("Sheet1").Range("B7:DE7").Cells If c.Interior.ColorIndex = 4 Then Range("DH7").Value = Range("DH7").Value + c.Value Also, is there a way to specify Range("DH") and make the row be the current row, not hard coded to 7
When I launch excel 2007, i have cells with a grey border. I'm not sure what the colorindex is of this border.
Through a macro, when I format cells, I use
Cells(x,y).BorderAround ColorIndex:=xlAutomatic
xlAutomatic points to BLACK by default. Could someone tell me how I could reference the actual default colorindex (the grey one which seems to border all other cells, while not being xlAutomatic)?
I am trying to develop an Excel spread- sheet by using some macros. In detail, in my first worksheet, I have something like -
Exp1 .... Exp2 .... Exp3 .... : : : Expn ....
This rows are coming from another worksheet and I have used a macro (developed by me) to populate these rows. Even the number of rows to be populated is not fixed. However, I would like to add one row with text - " Total Expense" after those rows. This row will have some background color - say Tan - and font color - say Green - and also a border around its own - in nature, the border will be thick, Double and with color Rose. I have tried the following code in macro but not working properly -
Sub Include_Fields_n_Format(loc As String) tot_exp_scell = loc & f_scell tot_exp_ecell = loc & (f_scell + 1) Range(tot_exp_scell, tot_exp_ecell). Merge Range(tot_exp_scell, tot_exp_ecell).WrapText = True
Range(tot_exp_scell, tot_exp_ecell).Interior.Color = RGB(150, 150, 150) With Range(tot_exp_scell, tot_exp_ecell).Font...................
I am trying to assign a border and fill to cells, of identical colors, using VBA. Simple enough, yes? I am using the same RGB value for both the fill and the border, but in Excel 2003, they are assigned two different colors: the fill is the correct shade, but the border is not, which makes absolutely no sense to me. I could understand if both colors were slightly off from the shade I'm getting in 2007, but to have one be correct and the other not? I can manually assign the border to be the proper color, but this doesn't help.
I've been trying to come up with a conditional that will format a row if a cell contains any instance of a given word.
I know the following will format rows containing the EXACT entry of "apple" in column E: =$E1="apple"
But I'd like a conditional that will find entries like "apple pie" and "crabapple" as well. I'm sure it's a simple solution, using a SEARCH function or something...but I can't figure it out.
I have a spreadsheet with 12 coloums. In the last coloum are the ords "yes", "no", or is empty (null?). I need to find a way to have each row that contains the word "no" or is empty to be highlighted in red font and bold type. When the word "yes" is typed then the font is black and the type in normal. This allows me to see at a glance what orders have not been picked up or have problems.
Let's say this is my data. It's already been sorted so that like entries are all grouped together.
Ex1 Ex1 Ex1 Ex2 Ex2
I need to make a macro that numbers my data like below.
1 Ex1
2 Ex1
3 Ex1
1 Ex2
2 Ex2
Essentially, my data is many columns and sorted on a bunch of different levels. I need a quick way to assign a rank to every row in the same group, to see at a glance which performed the best.
I am using Excel 2007. One of my worksheets has a dark border around some cells. Instead of being blue the lines are black. I used the right click and format cells option but it does not work.
I have cells within a column that could contain both text and dates. When a date is entered - the activity is complete. I want the cell color to automatically turn green when a date is entered. Conditional formatting seems to use ranges, or today's date, or > than and < than... and I want the cell the turn green when any date is entered. I haven't been able to find either vba code or an excel formula that will work.
I am looking to change to color of an entire row based on the value of a single column in that row....Say I have an issue on a line and the "priority column is set to high" I would like that entire row to turn red....
I am looking to change to color of an entire row based on the value of a single collumn in that row....Say I have an issue on a line and the "priority collumn is set to high" I would like that entire row to turn red....