Macro That Will Shade Entire Row Red
Jun 4, 2014
I have a spreadsheet with columns a-v. Column F (titled aging) displays how many days old an issue is. I would like to have a macro that will automatically shade a row light red if the number is less than 90. I don't want the entire row shaded, just the contents of column a-v.
View 2 Replies
ADVERTISEMENT
Jun 5, 2008
I want to catch an error and reset the entire code to the very beginning and skip that entire entry. When I use "Next fieldSheetName" I get "Next without For," error 1004. Searches tell me I have an open block somewhere, but that's not true. Removing that statement (and having the loop iterate as normal) has no error at all.
Dim employeeName As String
Dim fieldMax, x, y As Byte ' Counters mostly
Dim workedHours, fieldSheetName As Integer
fieldMax = 204 ' Row number to stop on in the field time sheet
row = 4 ' Row specification for field time sheet. Begin at row 4 to ignore headers
' and start on the first name. This should not be changed!
Col = 3 ' Start at column 3 then increase by one to start going to next time entry
' RESET HERE!
For fieldSheetName = 4 To fieldMax Step 8 ' This is our MAIN loop. It iterates from 0 to fieldMax, which is 204...........
View 9 Replies
View Related
Nov 12, 2013
I have created one excel which contains column with range. (A1:A6). and the drop box included the values as Passed, failed, NA, NC) i have coded the the macro to change color as if i select passed from A1 then A1: F1 will be Red. please find the below code.
Sub Prasanna1()
Range("A1").Select
Select Case Range("A1").Value
Case "Prasanna"
Range("A1:F1").Interior.ColorIndex = 7
Case "Kale"
Range("A1:F1").Interior.ColorIndex = 0
[Code]...
The code is working fine for one row. Now i want to set the same code for entire column A. as if i will select A10 the same range of row should get change with fill color.
View 3 Replies
View Related
Mar 17, 2014
If column B contains the word FALSE, I need to delete that entire row, then I need to repeat this action on 11 sheets out of 14 on one workbook, in one action.
View 6 Replies
View Related
May 16, 2009
Here's what i am trying to do... I have a workbook with lots of info, i believe there is a way to highlight an entire row and then run a macro that will then collect the info from certain columns (along the specific highlighted row) say, columns A-F and M & P for one example, the collected data will then be copied to a new pre-designed template, and pasted into set cells. The cells that the data will be pasted into will not be along one row though, the pre-defined template will resemble say, an application form Can this be done, I understand macros only at a basic level currently but am trying to understand the VBA way of creating them too now.
View 9 Replies
View Related
Sep 1, 2009
Any time that any data is entered into one of the cells within my spreadsheet I would like the cell in which data is entered (and only the cell in which data is entered) to automatically become shaded (gray, preferably). I know conditional formatting should be used, but beyond that, I have no clue what to do. I would also prefer not to have to enter in conditional formatting formulas into all 105 cells, but I will do it if necessary.
Just in case, here's a little more information on what I am doing: I will be sending this spreadsheet out to about 10 others, and when they enter their name on a particular day at a particular time, I want that cell to become shaded. Other people might also enter their names at that day and time as well, so I would want the cell to stay shaded if that happens. Macros are not an option, because of security reasons.
View 4 Replies
View Related
May 22, 2009
I am trying to create an event that would shade certain cells if a cell is active.
For example if the active cell is cell J39, shade the following rows as follows:
View 9 Replies
View Related
Dec 6, 2009
I need to add a Macro/VBA script to a spreadsheet i'm working on which will shade all cells, within a workbook, if the cell contains a formula (eg: =sum(A1:A5))
I can't get it to work under conditional formatting, nor with my limited knowledge of VBA.
View 12 Replies
View Related
Jan 13, 2009
I have a work sheet that has a date in a cell B7 and the system Date is Cell AB4.
What I wish for the sheet to do is shade the cell depending on the following criteria: If the date in Cell B7 is 2years and 10 months Before the System date to shade it Green, If the Date is Between 2 years 10 month and 3 Years before the System date shade yellow and if it is 3years and over shade Red.
For example if the date in B7 is 11-12-08 and the system date is 13-01-09 then the cell will be shaded Green.
View 9 Replies
View Related
May 18, 2006
I'm trying to come up with vba code that will gray out a set of cells when a certain value is enter in another cell.
View 9 Replies
View Related
Dec 15, 2006
I am trying to find a formula for my grade book. What I want to be able to do is shade every cell that has a value of zero (but not empty cells) so that when I print out the grade book, I can easily see all missing assignments.
View 4 Replies
View Related
May 10, 2014
I got a problem with a macro i'm working on. I got column D which contains text as "Figures", "Toys", "3DS", "PS3" etc. I also got column N where i need the macro to display "Toys" if it's a toy, figure, etc; or "Games" if it's "PS3", "PS4" etc.
I'm using the following code, to also select only blank rows (so to ignore row 1 which is table header). Problem is that the result shows only "Games".
VB:
Columns("N:N").Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.FormulaR1C1 = "=IF(RC[-9]=""*toys*"",""Toys"",""Games"")"
View 4 Replies
View Related
Jun 2, 2014
I recored a macro to Cut the entire "E" column and paste on "A". For some reason when i read the code it doesnt capture the part where it needs to paste it in column "A".
View 1 Replies
View Related
Feb 25, 2014
This macro clears all the contents of each sheet to which it refers, however, after putting it to use I find that I need it to clear only columns A-G starting at row 10. I am not sure how to modify it to do so though. Actually it would be even better if it would only clear columns A, B, C, E, F, and G.
View 14 Replies
View Related
Feb 6, 2009
For simplicity, let's assume I have three columns, "Company," "Policy," and "Balance."
Example:
Company A Life $1
Company A Med $2
Company A Dent $3
Company A Disab $4
Company B Life $9
Company B Med $5
Company B Dent $7
Company B Disab $2
According to my post preview, the columns are running together, but I do have it arranged in three distinct columns. What I want to do is program a macro to do the following:
Every time the name of the company changes, I want Excel to insert two rows after the last of the group, and have a summation of the "Balance" column in the first inserted row.
This is what it should look like:
Company A Life $1
Company A Med $2
Company A Dent $3
Company A Disab $4
$10 <- (this should be directly under the $4, but I'm not good with forum languages)
Company B Life $9
Company B Med $5
Company B Dent $7
Company B Disab $2
$23 <- (same with this - should be directly under the $4)
View 3 Replies
View Related
Nov 15, 2006
Sub Delete()
Dim x As Long
For x = 28 To 8 Step -1
If Range("b" & x) = "" Then _
Range("b" & x).EntireRow.Delete
Next x
End Sub
View 9 Replies
View Related
Feb 20, 2010
I have written Macro to copy every row in "sheet1" 24 times into new sheet called "NewSheet". but it keep giving me error message. Actually, I don't know why. Can any one please help.
here is my macro
Sub CopyRowsBook2()
Worksheets.Add().Name = "NewSheet"
Sheets("Sheet1").Select
' Find the last row of data
FinalRow = Cells(Rows.Count, 1).End(xlUp).Row
' Loop through each row
For x = 2 To FinalRow
Worksheets("sheet1").Cells(x, 1).Select
ActiveCell.EntireRow.Select
Selection.Copy
' Loop to copy every row 24 times
For i = 1 To 24
Sheets("NewSheet").Select
NextRow = Cells(Rows.Count, 1).End(xlUp).Row + 1
Cells(NextRow, 1).Select
ActiveSheet.Paste
Next i
Sheets("Sheet1").Select
Next x
End Sub
View 9 Replies
View Related
Aug 14, 2007
I have Excel 2002. I need to create a formula that will move an entire row to another page within the same workbook if a cell in that row has a certain value. Example would be if A1 cell in the row has a value of 111 I need to move the entire row to another page. I could use the sort then cut function in a macro but the spread sheet I'm working with changes daily. One day there will be 10 A1 cells with 111 the next 30 cells with 111 in A1 and some days no cells with 111.
View 4 Replies
View Related
Apr 28, 2014
I have a graph and wanted to be able to shade in color gray the data that fall within highlighted.
Test.xlsx
View 1 Replies
View Related
Jun 27, 2013
I have put together a duration schedule for work and have it set up now so the days with automatically fill if they are on or between the start/end date. Below is the formula that I have constructed. As of right now each activity is colored the same. I would like to have each activity match the color of the person performing it. My crew names are all in column A with a conditional format to be color coded with the name entered.
View 11 Replies
View Related
Jan 12, 2013
As I input data down a column in a wide Excel spreadsheet I would like to have highlighted the line I am working on as a check that I am in the correct place. I know that I can hit 'shift', 'space' for a single line, but is there a way to do it without having to hit those keystrokes each time?
View 2 Replies
View Related
Jan 14, 2014
way to shade/color a cell with a filter that is in use. . . that way, a user doesn't have to look at microscopic drop down filters to figure out which column is being filtered. .
View 1 Replies
View Related
Dec 1, 2011
What's the best way to shade in the area under a line graph?
View 1 Replies
View Related
Jun 17, 2014
I am fairly new to VBA and I am having some trouble with a VBA routine that was used in some workbooks I was given and I am trying to reuse that code.
What I am attempting to do is to shade the rows (alternate colors) whose value in Column C is the same until that value changes.
Example:
Row 1, 2 & 3 all have the same value in Column C so these would shade color 15
Row 4 thru 10 have a different value in Column C so those would have no shade
Row 11 thu 13 have a different value in Column C so these would then be Shade 15
So here is what I have done:
I set the range for the routine to step thru, then I defined the row & column to start processing. I then compare the current row to the row above. If the values are different then I compared the colors of the rows, and set the active row to the opposite color.
This routine runs but the first cell in each grouping isn't being shaded but then the rest of the rows are shaded correctly.
I have searched the web and look thru my code several times but to no avail, I cannot seem to understand why this will not work.
Code:
Sub grid_coloring()
Dim rwIndex, colindex, colindex2, ncount, bcount As Integer 'set rwindex, colIndex as an output number for columns. bcount and ncount are for counting blanks and dupes
Dim theRng As Range
Dim FirstRow, FirstCol, LastRow, LastCol As Integer
[Code] ..........
View 8 Replies
View Related
Nov 10, 2008
I have a macro that will go through a set of numbers and check them against a condition. if the cell complies with the condition i want to copy the entire row to a new sheet. sofar I have tried the following to select the current row but to no avail.
View 4 Replies
View Related
Oct 12, 2010
I have an existing macro that takes my sheet and puts it in body of email.
how do i add to it to change the entire worksheet's font?
Code:
Function RangetoHTML(rng As Range)
Dim fso As Object
Dim ts As Object
Dim sTempFile As String
Dim objWB As Workbook
Dim i As Long
Dim iLastRow As Long
sTempFile = Environ$("temp") & "/" & Format(Now, "dd-mm-yy h-mm-ss") & ".htm"
[code]....
View 4 Replies
View Related
Dec 29, 2011
I have a macro that delete empty cells in a column, what i wanted to do is while deleting the empty cells is that the macro will also delete duplicates in ENTIRE WORKSHEETS. My file has so many sheets so i need a macro that run or loop on my entire worksheets.
This is my code. that only runs in a single sheet.
Code:
Sub deleteblanks()
Columns("H").SpecialCells(xlBlanks).Delete (xlUp)
End Sub
[Code] ..............
View 9 Replies
View Related
Aug 21, 2007
How can we delete entire row using VB Code.
say example i want to delete a row having name 'Anis' by clicking on a buttton
is this possible?
View 9 Replies
View Related
Oct 8, 2007
My workbook is set up such that column B has dates (starting in B11 and going to B1200). C11:Z1200 has data that correspondes to the date in Column B. There are a lot of dates that don't have data. For example, row 15, there is a date in B15 but no other information for the remainder of row 15.
I'm trying to write a macro that will delete entire rows for the dates in which there is no data. So, I'm presuming that it would search C15:Z15, if there is not information in these cells, then delete row 15.
Row 16 becomes 15 when you delete 15.. I don't know how to get around this.
View 9 Replies
View Related
Mar 1, 2010
I've created an Excel 2007 workbook with about a dozen worksheets that are full of formulas and links to other workbooks, as well as conditional formatting that isn't backwardly compatible with Excel 2003. However, many people who want to see this workbook are still on Excel 2003. I need to recreate an Excel 2003 compatible workbook with the appearance and formatting of the original and have all the formulas and links converted to values. So, the final product will "look" just like the original without the conditional formatting, links or formulas. It will just have the look, colors and values displayed for all cells.
Essentially, I want a macro that will copy however many worksheets (1-n) are in an Excel 2007 workbook to a new Excel 2003 workbook. I'd like the worksheets to retain their label names as well.
View 9 Replies
View Related