Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hwo do i write this into a VBA code
where i want variable A to be set to 4 if the variable B is greater or equal to 14 otherwise it is to be set to 16 if the variable C lies between 5 and 10 otherwise it will be set to 9??? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub kod()
Dim varA, varB, varC As Integer On Error Resume Next ' varA, varB, varC should be initialized somehow If varB = 14 Then varA = 4 ElseIf varC = 5 And varC <= 10 Then varA = 16 Else varA = 9 End If End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If B = 14 then
A = 4 elseif C = 5 then If C <=10 then A = 9 End If End If -- Best wishes, Jim "paul" wrote: hwo do i write this into a VBA code where i want variable A to be set to 4 if the variable B is greater or equal to 14 otherwise it is to be set to 16 if the variable C lies between 5 and 10 otherwise it will be set to 9??? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jim, you got the homework wrong.
That is setting A=9 if C is between 5 and 10 and doesn't set A otherwise. "Jim Jackson" wrote: If B = 14 then A = 4 elseif C = 5 then If C <=10 then A = 9 End If End If -- Best wishes, Jim "paul" wrote: hwo do i write this into a VBA code where i want variable A to be set to 4 if the variable B is greater or equal to 14 otherwise it is to be set to 16 if the variable C lies between 5 and 10 otherwise it will be set to 9??? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How did you do on the last homework assignment?
"paul" wrote: hwo do i write this into a VBA code where i want variable A to be set to 4 if the variable B is greater or equal to 14 otherwise it is to be set to 16 if the variable C lies between 5 and 10 otherwise it will be set to 9??? |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Thu, 16 Aug 2007 04:47:34 -0700, paul wrote:
hwo do i write this into a VBA code where i want variable A to be set to 4 if the variable B is greater or equal to 14 otherwise it is to be set to 16 if the variable C lies between 5 and 10 otherwise it will be set to 9??? something like: If B = 14 Then A = 4 ElseIf C 5 And C < 10 Then A = 16 Else A = 9 End If --ron |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Coding | Excel Programming | |||
VBA coding | Excel Programming | |||
"=ROW()-1" type of coding doesn't appear in a filter / is there coding that does? | Excel Programming | |||
Implant macro coding into ASP coding | Excel Programming | |||
Need coding help. | Excel Programming |