IF Statements - Exercise

Excel VBA for Beginners 8- Must know Excel Logic
1 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$99.99
List Price:  $139.99
You save:  $40
€84.92
List Price:  €118.89
You save:  €33.97
£73.98
List Price:  £103.57
You save:  £29.59
CA$136.81
List Price:  CA$191.54
You save:  CA$54.73
A$148.86
List Price:  A$208.41
You save:  A$59.55
S$128.32
List Price:  S$179.66
You save:  S$51.33
HK$777.09
List Price:  HK$1,087.96
You save:  HK$310.87
CHF 78.82
List Price:  CHF 110.35
You save:  CHF 31.53
NOK kr1,000.83
List Price:  NOK kr1,401.21
You save:  NOK kr400.37
DKK kr634.47
List Price:  DKK kr888.29
You save:  DKK kr253.81
NZ$171.27
List Price:  NZ$239.79
You save:  NZ$68.51
د.إ367.21
List Price:  د.إ514.11
You save:  د.إ146.90
৳12,220.07
List Price:  ৳17,108.59
You save:  ৳4,888.52
₹8,980.55
List Price:  ₹12,573.13
You save:  ₹3,592.57
RM404.80
List Price:  RM566.74
You save:  RM161.94
₦145,094.48
List Price:  ₦203,138.08
You save:  ₦58,043.60
₨28,012.79
List Price:  ₨39,219.03
You save:  ₨11,206.23
฿3,107.58
List Price:  ฿4,350.74
You save:  ฿1,243.15
₺4,281.87
List Price:  ₺5,994.79
You save:  ₺1,712.91
B$554.37
List Price:  B$776.14
You save:  B$221.77
R1,665.96
List Price:  R2,332.41
You save:  R666.45
Лв166.02
List Price:  Лв232.43
You save:  Лв66.41
₩144,218.57
List Price:  ₩201,911.77
You save:  ₩57,693.20
₪319.22
List Price:  ₪446.92
You save:  ₪127.70
₱5,870.26
List Price:  ₱8,218.60
You save:  ₱2,348.33
¥15,650.93
List Price:  ¥21,911.93
You save:  ¥6,261
MX$1,792.52
List Price:  MX$2,509.60
You save:  MX$717.08
QR364.80
List Price:  QR510.74
You save:  QR145.93
P1,353.86
List Price:  P1,895.46
You save:  P541.60
KSh12,893.71
List Price:  KSh18,051.71
You save:  KSh5,158
E£4,754.90
List Price:  E£6,657.05
You save:  E£1,902.15
ብር15,549.68
List Price:  ብር21,770.18
You save:  ብር6,220.49
Kz91,219.48
List Price:  Kz127,710.93
You save:  Kz36,491.44
CLP$90,580.94
List Price:  CLP$126,816.94
You save:  CLP$36,236
CN¥700.59
List Price:  CN¥980.86
You save:  CN¥280.26
RD$6,274.51
List Price:  RD$8,784.56
You save:  RD$2,510.05
DA12,966.46
List Price:  DA18,153.57
You save:  DA5,187.10
FJ$226.89
List Price:  FJ$317.66
You save:  FJ$90.76
Q766.26
List Price:  Q1,072.80
You save:  Q306.53
GY$20,912.30
List Price:  GY$29,278.06
You save:  GY$8,365.76
ISK kr12,571.74
List Price:  ISK kr17,600.94
You save:  ISK kr5,029.20
DH911.53
List Price:  DH1,276.18
You save:  DH364.64
L1,677.17
List Price:  L2,348.10
You save:  L670.93
ден5,226.85
List Price:  ден7,317.80
You save:  ден2,090.95
MOP$800.34
List Price:  MOP$1,120.52
You save:  MOP$320.17
N$1,666.26
List Price:  N$2,332.83
You save:  N$666.57
C$3,679.91
List Price:  C$5,152.02
You save:  C$1,472.11
रु14,368.76
List Price:  रु20,116.83
You save:  रु5,748.07
S/336.66
List Price:  S/471.34
You save:  S/134.67
K431.86
List Price:  K604.62
You save:  K172.76
SAR375.03
List Price:  SAR525.06
You save:  SAR150.02
ZK2,254.68
List Price:  ZK3,156.64
You save:  ZK901.96
L432.10
List Price:  L604.96
You save:  L172.86
Kč2,058.75
List Price:  Kč2,882.33
You save:  Kč823.58
Ft32,856.71
List Price:  Ft46,000.71
You save:  Ft13,144
SEK kr915.69
List Price:  SEK kr1,282.01
You save:  SEK kr366.31
ARS$145,035.49
List Price:  ARS$203,055.49
You save:  ARS$58,020
Bs692.56
List Price:  Bs969.61
You save:  Bs277.05
COP$376,785.69
List Price:  COP$527,515.04
You save:  COP$150,729.35
₡49,626.14
List Price:  ₡69,478.58
You save:  ₡19,852.44
L2,636.01
List Price:  L3,690.52
You save:  L1,054.51
₲679,697.02
List Price:  ₲951,603.02
You save:  ₲271,906
$U3,919.50
List Price:  $U5,487.46
You save:  $U1,567.95
zł357.86
List Price:  zł501.02
You save:  zł143.16
Already have an account? Log In

Transcript

OK, so now we're going to have an exercise for the if statement. So we're going to use the ratings table on the right to write a macro using if statements to display a message box with the rating of the students from the student table on the left here, when you have his or her name selected, so you need to make sure that you have the student's name selected before you execute the macro. Okay, this is how the macros should work. So you need to make sure to construct the text on the message box using string concatenation. So you can catenate strings using the ampersand as shown on previous examples. So as examples of what a messagebox should say, Jennifer is excellent.

Adam has failed Bob has passed and Joe is good. And as a tip Make sure to try to change the values for the marks and rerun your macro to make sure it's working correctly. So this is a very simple macro that you're going to create you Using if statements to pop up some message boxes about the grades of the students. Okay, so you need to make sure to select the student's name before executing the macro. Now I do have the answer for the exercise here on the module called exercise answer. So if you get stuck Have a look at that answer, but please try to attempt the exercise yourself and if you have any questions, please leave them in the q&a section.

Thank you very much for watching this video and I'll see you on the next one.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.