PDA

Click to See Complete Forum and Search --> : Urgent Help needed from VBA Guru. Please [RESOLVED]


Bongo
Aug 21st, 2003, 09:00 AM
Greetings,

I need to create for a friend a small sheet which has one function.

Existing
a button on row/col 1 and in row 1 col 2 starting a whol month (1 col = 1 day)
in col 1 up from row 2
the column contains names.

If I put now the curser into any field in this matrix and the button is pressed then from this curser pos. the next 4 cells become green the next 2 whith and 4 green and 2 white again and so on.

The looping I can do I am from the VB corner but I never used VBA. So I need at least a entrie point wher I can get this infos how to do or a solution from the forum.

Any help is apreciated. Many thanks in advance
Manfred

adocwra
Aug 25th, 2003, 04:28 PM
Public Sub datefind()
Dim sCell As Range




For Each sCell In Selection
If IsDate(sCell.Value) Then sCell.Interior.ColorIndex = 6
Next
End Sub
OR
Public Sub datefind()
Dim sCell As Range




For Each sCell In Selection
If IsDate(sCell.Value) Then MsgBox (sCell.Address)
Next
End Sub
AND
PLACE SCELL.ADDRESS IN ANOTHER CELL

adocwra
Aug 25th, 2003, 05:16 PM
sorry wrong code



ActiveCell.Activate
ActiveCell.Resize(1, 4).Interior.ColorIndex = 6
ActiveCell.Offset(0, 4).Select
ActiveCell.Activate
ActiveCell.Resize(1, 2).Interior.ColorIndex = 2
ActiveCell.Offset(0, 2).Select
ActiveCell.Activate
ActiveCell.Resize(1, 4).Interior.ColorIndex = 6
'etc

Bongo
Aug 26th, 2003, 12:49 AM
Thanks adocwra,

got it now. I have two other q.

I fixed the first 2 rows horizontal.

1. How can i fix the first column as well?
2. How can i make sure the fixed first 2 rows are
not scrollable (horizontal)

many thanks again
Manfred

adocwra
Aug 26th, 2003, 08:22 AM
im sorry I cant understand exactly what you want can you elaborate please

or send the spreadsheet
thanks

Bongo
Aug 26th, 2003, 08:54 AM
is ok. I solved it. What I tryed to say was

How can I fix row 1 and column 1 together. Found the solution on the net.

Sorry for confusing you but english is not my first language.

Take care
Manfred