Hi all,
I have a Range("C2:AL2"). Each cell in the range has a formula refering to cell "A1" which contains the date for the month e.g Sept sheet has "01/09/2006" . The range is formatted as "d".
I'm trying to write a macro to add the below forumla in Range("C4:AL4") when it meets these criteria
1). It's the first cell
2). When the date is a Sat
So it also needs to amend the formula when it meets the criteria
e.g for Sept
C2 for first cell
D2 for first Sat
K2 for sec Sat
R2 for third Sat
Y2 for four Sat
AF2 for fifth Sat
=INT(((C2-1461)-SUM(MOD(DATE(YEAR(C2-MOD(C2,7)+3),1,2)-1461,{1E+99,7})*{1,-1})+5)/7)
lastly I want a xlThin border for each week so going back to Sept
C4 Would have a border
D2 to J4
K4 to Q4
you get the idea.
Here's the code I have so far.
Sub Wk_No()
' Dim variable rng to be a range object
Dim rng As Range
' Assign the object rng a range
Set rng = Range("C3:AL3")
' Check each item in rng
For Each x In rng
' If cell = Total then
If x.Value = "02/09/2006" Then
ActiveCell.Offset(1, 0).Range("A1").Select
End If
' Check the next item in rng
Next x
End Sub
Any help will be greatly appreciated.
VBA Noob
PS Sorry about the length of the post
Bookmarks