LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Range - Offset (Major help needed)


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.


Code:
--------------------

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


--
VBA Noob
------------------------------------------------------------------------
VBA Noob's Profile: http://www.excelforum.com/member.php...o&userid=33833
View this thread: http://www.excelforum.com/showthread...hreadid=554656

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Major help needed LiAD Excel Discussion (Misc queries) 2 February 4th 10 05:23 PM
Help with OFFSET statement needed tom Excel Worksheet Functions 2 August 28th 06 07:38 PM
Major Help Needed Asap ninjashadow80 Excel Worksheet Functions 7 July 24th 06 04:59 AM
Problem with Range.Cells.Offset and Range.Cells( row + offset, column) [email protected] Excel Programming 2 August 22nd 05 05:25 AM
Major help needed mike_vr Excel Discussion (Misc queries) 6 April 19th 05 12:31 PM


All times are GMT +1. The time now is 10:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"