excel macros

  • Thread starter Thread starter Andrew Barrimore
  • Start date Start date
A

Andrew Barrimore

Hello.I have some questions about macros.
I must complete one exercise in excel,which contains macros.
I have 3 cols
1.Date
2.Expense
3.Income
And i have 3 exercises:
1.Allow to put a number from 0 to 100 in 3. col ,but if the number is >100 ask for agreement.
2.Allow to fill Income col only when the date col if filled
3. Allow to fill Income col only when expense col in empty.

Can somebody help me with this exercise?





EggHeadCafe - Software Developer Portal of Choice
Dr. Dotnetsky's Cool .NET Tips and Tricks # 19
http://www.eggheadcafe.com/tutorial...8f57-bb41f7f8a8be/dr-dotnetskys-cool-net.aspx
 
Then here is a starter. Copy this code to the sheet code module. To access
the sheet code module, press Alt + F11 to open the VB editor. In the
Project window, double click on the sheet name. The title bar should
indicate that you have the sheet code module open. Paste the code in the
big window. Then save the file. Now enter a value greater than 100 in
column A. Then try entering a value of 100 or less into column A.

Sub WorkSheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
If Target.Value > 100 Then
MsgBox "Value too much"
Target = ""
End If
End If
End Sub
 
Back
Top