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: 14
Default Function in a VBA prog. or something like that

Hi there,

below there is a part of a score scar for a golf complex

in a prog i have these lines ( partial of the prog)

H1 = Sheets("Invoer").Range("F7").Value
H2 = Sheets("Invoer").Range("F8").Value
H3 = Sheets("Invoer").Range("F9").Value
H4 = Sheets("Invoer").Range("F10").Value

P1 = Sheets("Invoer").Range("D7").Value
P2 = Sheets("Invoer").Range("D8").Value
P3 = Sheets("Invoer").Range("D9").Value
P4 = Sheets("Invoer").Range("D10").Value

According to the calculation of H1 - P1

the case below should set a color.no.

Select Case Colornr
Case Is < -2 'Albatros or Better
Color = 111
Case Is -2 'Eagle
Color = 232
Case Is -1 'Birdie
Color = 193
Case Is 0 'Par
Color = 174
Case Is 1 'Bogey
Color = 235
Case Is 2 'D. Bogey
Color = 124
Case Is 2 'T. Bogey or Worse
Color = 227
End Select

is there an easy way to 'set color to the cell

i think it has something to do with a function but i do not know how

this is where the color needs to be set to

ActiveCell.Offset(1, 10).Value = H1
ActiveCell.Offset(1, 11).Value = H2
ActiveCell.Offset(1, 12).Value = H3
ActiveCell.Offset(1, 13).Value = H4

for example. P1 = 4, H1 = 6

so according to the case above ColorNo = 2
and color = 124

i do hope some body understands my problem.

Thanks for all your help

Swingleft





 
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
Open non-Office prog. macro Schneider_4 Excel Programming 4 October 5th 07 07:51 PM
If a prog is running stop and restart [email protected] Excel Programming 1 September 24th 06 05:49 PM
can a prog fill all data on a row from one entry? fraggle21 Excel Discussion (Misc queries) 2 July 9th 06 09:30 AM
why does my excel always freeze up and say that a de bugging prog riggyz Excel Discussion (Misc queries) 2 July 11th 05 08:22 PM
Data exchange between a DDE prog and excel Leo Butler Excel Programming 0 December 22nd 04 11:23 AM


All times are GMT +1. The time now is 09:42 PM.

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"