PC Review


Reply
 
 
Beep Beep
Guest
Posts: n/a
 
      7th Apr 2008
What I would like to do is have a macro to do the following. Pick the FC
date and then go to the same date to the right and color & bold that cell
yellow and also color the two cells prior to that also yellow. Example:
Color Yellow Oct 07 - Nov 07 - Dec 07 for FC date

For CS date Jan 08; Feb 08 and Mar 08

Then pick the CS date and to the same except color these cells blue.

I only want to start with dates equal to or greater than January 2008.

FC date CS date Oct-07 Nov-07 Dec-07 Jan-08 Feb-08
19-Dec-07 26-Mar-08 0 0 0 0 0 0

 
Reply With Quote
 
 
 
 
Joel
Guest
Posts: n/a
 
      7th Apr 2008

MyDate = Range("A2")
'get first day of month

ColCount = 3
Do While Cells(1, ColCount) <> ""
If Month(MyDate) = Month(Cells(1, ColCount)) And _
Year(MyDate) = Year(Cells(1, ColCount)) Then

Exit Do
End If
ColCount = ColCount + 1
Loop

FirstCol = ColCount - 2
If FirstCol < 3 Then
FirstCol = 3
End If
For MyColumns = FirstCol To ColCount
Cells(2, MyColumns).Interior.ColorIndex = 6
Cells(2, MyColumns).Font.Bold = True

Next MyColumns
"Beep Beep" wrote:

> What I would like to do is have a macro to do the following. Pick the FC
> date and then go to the same date to the right and color & bold that cell
> yellow and also color the two cells prior to that also yellow. Example:
> Color Yellow Oct 07 - Nov 07 - Dec 07 for FC date
>
> For CS date Jan 08; Feb 08 and Mar 08
>
> Then pick the CS date and to the same except color these cells blue.
>
> I only want to start with dates equal to or greater than January 2008.
>
> FC date CS date Oct-07 Nov-07 Dec-07 Jan-08 Feb-08
> 19-Dec-07 26-Mar-08 0 0 0 0 0 0
>

 
Reply With Quote
 
Beep Beep
Guest
Posts: n/a
 
      13th May 2008
Hi Joel:

A while back you gave me this macro, however it doesn't seem to want to
work. When I try to step into it (F8) it goes no where and no error
messages.

"Joel" wrote:

>
> MyDate = Range("A2")
> 'get first day of month
>
> ColCount = 3
> Do While Cells(1, ColCount) <> ""
> If Month(MyDate) = Month(Cells(1, ColCount)) And _
> Year(MyDate) = Year(Cells(1, ColCount)) Then
>
> Exit Do
> End If
> ColCount = ColCount + 1
> Loop
>
> FirstCol = ColCount - 2
> If FirstCol < 3 Then
> FirstCol = 3
> End If
> For MyColumns = FirstCol To ColCount
> Cells(2, MyColumns).Interior.ColorIndex = 6
> Cells(2, MyColumns).Font.Bold = True
>
> Next MyColumns
> "Beep Beep" wrote:
>
> > What I would like to do is have a macro to do the following. Pick the FC
> > date and then go to the same date to the right and color & bold that cell
> > yellow and also color the two cells prior to that also yellow. Example:
> > Color Yellow Oct 07 - Nov 07 - Dec 07 for FC date
> >
> > For CS date Jan 08; Feb 08 and Mar 08
> >
> > Then pick the CS date and to the same except color these cells blue.
> >
> > I only want to start with dates equal to or greater than January 2008.
> >
> > FC date CS date Oct-07 Nov-07 Dec-07 Jan-08 Feb-08
> > 19-Dec-07 26-Mar-08 0 0 0 0 0 0
> >

 
Reply With Quote
 
Joel
Guest
Posts: n/a
 
      14th May 2008
did you put the code in a subroutine?

Sub test()

MyDate = Range("A2")
'get first day of month

ColCount = 3
Do While Cells(1, ColCount) <> ""
If Month(MyDate) = Month(Cells(1, ColCount)) And _
Year(MyDate) = Year(Cells(1, ColCount)) Then

Exit Do
End If
ColCount = ColCount + 1
Loop

FirstCol = ColCount - 2
If FirstCol < 3 Then
FirstCol = 3
End If
For MyColumns = FirstCol To ColCount
Cells(2, MyColumns).Interior.ColorIndex = 6
Cells(2, MyColumns).Font.Bold = True

Next MyColumns

End Sub

"Beep Beep" wrote:

> Hi Joel:
>
> A while back you gave me this macro, however it doesn't seem to want to
> work. When I try to step into it (F8) it goes no where and no error
> messages.
>
> "Joel" wrote:
>
> >
> > MyDate = Range("A2")
> > 'get first day of month
> >
> > ColCount = 3
> > Do While Cells(1, ColCount) <> ""
> > If Month(MyDate) = Month(Cells(1, ColCount)) And _
> > Year(MyDate) = Year(Cells(1, ColCount)) Then
> >
> > Exit Do
> > End If
> > ColCount = ColCount + 1
> > Loop
> >
> > FirstCol = ColCount - 2
> > If FirstCol < 3 Then
> > FirstCol = 3
> > End If
> > For MyColumns = FirstCol To ColCount
> > Cells(2, MyColumns).Interior.ColorIndex = 6
> > Cells(2, MyColumns).Font.Bold = True
> >
> > Next MyColumns
> > "Beep Beep" wrote:
> >
> > > What I would like to do is have a macro to do the following. Pick the FC
> > > date and then go to the same date to the right and color & bold that cell
> > > yellow and also color the two cells prior to that also yellow. Example:
> > > Color Yellow Oct 07 - Nov 07 - Dec 07 for FC date
> > >
> > > For CS date Jan 08; Feb 08 and Mar 08
> > >
> > > Then pick the CS date and to the same except color these cells blue.
> > >
> > > I only want to start with dates equal to or greater than January 2008.
> > >
> > > FC date CS date Oct-07 Nov-07 Dec-07 Jan-08 Feb-08
> > > 19-Dec-07 26-Mar-08 0 0 0 0 0 0
> > >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How to color automatically color code sums in cells JE McGimpsey Microsoft Excel Charting 0 29th Nov 2006 03:16 AM
How do I apply color in cells ..color now shown only in print prev =?Utf-8?B?Ym9uYWRpbWk=?= Microsoft Excel Worksheet Functions 1 25th Apr 2006 07:34 PM
change fill color of a range of cells based on color of a cell? =?Utf-8?B?RGFyTWVsTmVs?= Microsoft Excel Programming 0 2nd Mar 2006 06:35 PM
Excel 2003 will not display color fonts or color fill cells =?Utf-8?B?RGF2ZUM=?= Microsoft Excel Worksheet Functions 1 11th Apr 2005 04:38 PM
My excel 2003 wont let me fill cells with color or color the tabs. =?Utf-8?B?dHJpem9n?= Microsoft Excel New Users 2 22nd Feb 2005 06:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:08 PM.