PDA

View Full Version : Place format under each date



Shazam
07-19-2006, 08:07 AM
Hi everyone,



Is it possible to place a certain format under each date in the worksheet and filldown the format to the last cell in column A. The reason why because the dates are not set in thoses columns it fluctuates to column to column.

The format I would like is:

Accounting 0.00


Any help will be great.

OBP
07-19-2006, 09:46 AM
Shazam, sorry, are you talking of Dates or data?
Do you just want the format in Column "A"?

Norie
07-19-2006, 12:10 PM
Shazam

Do you mean you want to format each cell in the columns with dates in row 1 as Accounting?

Shazam
07-19-2006, 12:58 PM
Shazam

Do you mean you want to format each cell in the columns with dates in row 1 as Accounting?

Yes,

So far I got this and it works. It looks for the text "Last Week" and place the format minus one column where the dates are at.




With ActiveSheet
lastRow = .Cells(.Rows.Count, 1).End(xlUp).Row
Set yRng = .Range("2:2") Set y = yRng.Find("Last Week")
Set rngFirst = y
Do
Set y = yRng.FindNext(y)

Range(y.Offset(0, -1), .Cells(lastRow, y.Column - 1)).NumberFormat = _
"_(* #,##0.00_);_(* (#,##0.00);_(* ""-""??_);_(@_)"
Loop Until y.Address = rngFirst.Address
End With

Edited 20-Jul-06 by geekgirlau. Reason: insert line breaks

mdmackillop
07-19-2006, 01:20 PM
Hi Shazam, It's the VBA tags you need to use, along with the line breaks. Regards MD

Shazam
07-19-2006, 02:11 PM
Hi Shazam, It's the VBA tags you need to use, along with the line breaks. Regards MD


Thanks mdmackillop I'm keep forgetting to use that.