Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default I Need Help To Do This Code In A Macro


If need help make this code in a macro !!

. Variable CLI - Macro

BR = Business Relevance
n-r = non-relevant

-----------------------------------------------------------
IF BR = “n-r” THEN
BEGIN (1)
If KI < 1.5 then
begin
write “CLS 11”
write “overqualified”
SelectColor = Turquise
end

else if 1.5 <= KI < 2.5 then
begin
write “CLS 12”
write “overqualified”
SelectColor = Turquise
end

else if 2.5 <= KI then
begin
write “CLS 13”
write “overqualified”
SelectColor = Turquise
end
END (1)
-----------------------------------------------------------

ELSE IF BR = “medium” THEN
BEGIN (2)
If KI < 1.5 then
begin
write “CLS 04”
write “OK”
SelectColor = Bright Green
end

else if 1.5 <= KI < 2.5 then
begin
write “CLS 05”
write “OK”
SelectColor = Bright Green
end

else if 2.5 <= KI then
begin
write “CLS 16”
write “overqualified”
SelectColor = Turquise
end
END (2)
-----------------------------------------------------------


ELSE IF BR = “high” THEN
BEGIN (3)
If KI < 1.5 then
begin
write “CLS -27”
write “critical”
SelectColor = Red
end

else if 1.5 <= KI < 2.5 then
begin
write “CLS -18”
write “needs improvement”
SelectColor = Light Yellow
end

else if 2.5 <= KI then
begin
write “CLS 09”
write “OK”
SelectColor = Bright Green
end
END (3)
-----------------------------------------------------------

ELSE
BEGIN (4)
write “ERROR”
END (4

--
dpji
-----------------------------------------------------------------------
dpjim's Profile: http://www.excelforum.com/member.php...fo&userid=2514
View this thread: http://www.excelforum.com/showthread.php?threadid=38672

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default I Need Help To Do This Code In A Macro


Not exactly sure about the content, but this shows the basic structure
The indendation helps here.:-

Code
-------------------

Sub untested()
' TO SHOW CODE STRUCTURE ONLY
Dim MyCell As Range
MyCell = ActiveSheet.Range("A1")
'-------------------------------------------------
Select Case BR
Case Is = "n - r"
If KI < 1.5 Then
MyCell.Value = "CLS 11" & " overqualified"
MyCell.Interior.ColorIndex = 42
ElseIf 1.5 <= KI < 2.5 Then
MyCell.Value = "CLS 12" & " overqualified"
MyCell.Interior.ColorIndex = 42
ElseIf 2.5 <= KI Then
MyCell.Value = "CLS 13" & " overqualified"
MyCell.Interior.ColorIndex = 42
End If
Case Is = "medium"
If KI < 1.5 Then
MyCell.Value = "CLS 11" & " overqualified"
MyCell.Interior.ColorIndex = 42
ElseIf 1.5 <= KI < 2.5 Then
MyCell.Value = "CLS 12" & " overqualified"
MyCell.Interior.ColorIndex = 42
ElseIf 2.5 <= KI Then
MyCell.Value = "CLS 13" & " overqualified"
MyCell.Interior.ColorIndex = 42
End If
Case Is = "high"
If KI < 1.5 Then
MyCell.Value = "CLS 11" & " overqualified"
MyCell.Interior.ColorIndex = 42
ElseIf 1.5 <= KI < 2.5 Then
MyCell.Value = "CLS 12" & " overqualified"
MyCell.Interior.ColorIndex = 42
ElseIf 2.5 <= KI Then
MyCell.Value = "CLS 13" & " overqualified"
MyCell.Interior.ColorIndex = 42
End If
End Select
End Sub

-------------------

--
Brian

-----------------------------------------------------------------------
BrianB's Profile: http://www.excelforum.com/member.php...tinfo&userid=5
View this thread: http://www.excelforum.com/showthread.php?threadid=38672

Reply
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
Deleting code from a macro (by a macro) Brettjg Excel Discussion (Misc queries) 2 May 8th 07 10:14 PM
Macro copying macro code TNSKHelp Excel Programming 1 June 17th 05 04:59 PM
Macro to change Macro code? Kaisies Excel Programming 2 March 23rd 05 03:34 AM
Excel XP VBA code to search all macro code in Excel module for specific search string criteria Ed[_18_] Excel Programming 4 May 20th 04 02:08 PM
Excel XP VBA code to search all macro code in Excel module for specific search string criteria Frank Kabel Excel Programming 0 May 19th 04 08:11 PM


All times are GMT +1. The time now is 11:01 AM.

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

About Us

"It's about Microsoft Excel"