Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


If condition in VBA


If condition in VBA

Author
Message
nadeembca
nadeembca
Forum Guru
Forum Guru (115 reputation)Forum Guru (115 reputation)Forum Guru (115 reputation)Forum Guru (115 reputation)Forum Guru (115 reputation)Forum Guru (115 reputation)Forum Guru (115 reputation)Forum Guru (115 reputation)Forum Guru (115 reputation)

Group: Forum Members
Posts: 3, Visits: 12
I would like to do this.



If the condition is met I would like to perform two different tasks in VB Excel. The simple syntex of If condition is this



If (Logical Condition) then



Task to perform



End if





However, I would like to perform multiple tasks to be performed not only one. How would I code it ? How to separate the second task ?


Nady
Mark
Mark
Forum God
Forum God (4.9K reputation)

Group: Moderators
Posts: 1.1K, Visits: 11K
There's no problem putting code for 2 tasks inside one if statement.



If (Logical Condition) then



Code for Task1



Code for Task2



End if
nadeembca
nadeembca
Forum Guru
Forum Guru (115 reputation)Forum Guru (115 reputation)Forum Guru (115 reputation)Forum Guru (115 reputation)Forum Guru (115 reputation)Forum Guru (115 reputation)Forum Guru (115 reputation)Forum Guru (115 reputation)Forum Guru (115 reputation)

Group: Forum Members
Posts: 3, Visits: 12
Thanks, It worked.

Nady
GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search