PDA

View Full Version : Conditional Formatting



austenr
09-02-2015, 01:43 PM
I'm sure this can be done but have no idea where to start.

Lets say say in workbook A you have a cell with the format. jan-15 and so on for the rest of the year.

Workbook B you have a column with names in this case column A and there are headers for every month, like jan-15, feb-15, etc.

main workbook B, there is formatting let's say it's green that spans a row next to a persons name and the cells jan thru may are colored green. This means that the person has that span of time to get a task completed.

On Workbook A, the month mar-15 is selected. I need the colored formatting that exists for jan thru may cleared and moved to the next year beginning in mar-16 for 5 months signifying the person has 5 months from mar-16 to complete the task next year.

It it may be confusing and I can upload workbooks if someone can help me out. I know I probably need a formula for conditional formatting if not rules and for sure need a worksheet change event Thanks for any input and I can post workbooks if anyone can help.

winon
09-03-2015, 09:16 AM
Hello austenr,


It it may be confusing and I can upload workbooks if someone can help me out. I know I probably need a formula for conditional formatting if not rules and for sure need a worksheet change event Thanks for any input and I can post workbooks if anyone can help.

It might be possible to side-step a worksheet change event within VBA altogether, by maybe linking the Workbooks with formulas, and apply CF from there.

It would help if you could upload sample workbooks showing a before and after scenario. No promises, but just maybe I could help.:)

Regards.

austenr
09-03-2015, 12:53 PM
here is my sample workbook. if a user clicks September 15 in the workbook SRM on the row CBM Scorecoard then highlight the corresponding columns starting with September 2016. However, if the date October 2015 is chosen it needs to start in October 2016. Can you do that?

austenr
09-04-2015, 08:57 AM
Decided to go a simpler way but still need help. I need a conditional formatting rule or VBA that says look in each row for the first range highlighted in Yellow. If there is an X in that cell, then, move 12 cells to the right and apply the same formatting.

So if you could write something that would look in all columns for an X and if the X is found in D5, move 12 cells to the right and apply yellow formatting for six cells.

I tried this but it doesnt work:


Sub Macro1()
'
' Macro1 Macro
Dim r, cell As Range
Set r = Range("D:W")
'
Sheets("Master Schedule").Select
For Each cell In r
If cell.Value = "X" Then
cell.Offset(0, 4).Select
Selection.Copy
cell.Offset(0, 12).Select
Selection.PasteSpecial Paste:=xlPasteAllUsingSourceTheme, Operation:=xlNone _
, SkipBlanks:=False, Transpose:=False
End If
Next
End Sub

austenr
09-04-2015, 12:20 PM
Going to cross post this as there seems to be no interest.