If Then Statement in Excel VBA (Macro) - Code Included

preview_player
Показать описание
Grab the Free VBA Quick Reference Guide
The If Then statement in Excel VBA will execute some code if a specific criteria it met (Or is True).

Code:
================
Sub Ifs()

x = 10

If x = 10 Then
MsgBox "YaY"
End If

'X _ X ' Greater Than
'X _= X 'Greater Than or Equal to
'X _ X ' Less Than
'X _= X 'Less Than or Equal to
'X = X ' Equal To
'X __ X 'Not Equal To

End Sub
Рекомендации по теме
Комментарии
Автор

Hello,


How would I add a Row based on a Cell's Value (only One time).
My data is sorted (largest to smallest), and now I want to add three rows above the first row that has 1.0 as a value.


so:
10.5
5.8
2.4
(Row)
(Row)
(Row)
1.0

cariday
Автор

i have the exact same question. how do i make the macro's if statement dependent on a value in the worksheet?

quantum
Автор

How do I make "X" a cell? So when cell A1>10 it shows the MsgBox?

SteveTremper
Автор

How do u do match in vba. Example say A2 has 2 that match b2 that has 2

Dopeboyz
join shbcf.ru