![]() |
Visual basic code query
Ive coded various items of data and assigned values to each item such that
when I produce a total I want to lookup a particular cell and check for the total in it and then run a specific program associated with that total. For example, when the total in, say, cell A50 is 60 I want it to trigger application A, if 61 then application B etc. So how would I write a Visual Basic program to: check the value of this cell containing my total (which may be, for example, between 60 and 120) and then run the program I have associated with that number? Many thanks |
Visual basic code query
Try something like this:
Sub test() Select Case Range("A50").Value Case 60 Call Application_A Case 61 Call Application_B 'etc. ... Case Else ' ... End Select End Sub Regards, Stefi €˛Zakynthos€¯ ezt Ć*rta: Ive coded various items of data and assigned values to each item such that when I produce a total I want to lookup a particular cell and check for the total in it and then run a specific program associated with that total. For example, when the total in, say, cell A50 is 60 I want it to trigger application A, if 61 then application B etc. So how would I write a Visual Basic program to: check the value of this cell containing my total (which may be, for example, between 60 and 120) and then run the program I have associated with that number? Many thanks |
Visual basic code query
Stefi,
Many thanks for your help. Best wishes, Tony "Zakynthos" wrote: Ive coded various items of data and assigned values to each item such that when I produce a total I want to lookup a particular cell and check for the total in it and then run a specific program associated with that total. For example, when the total in, say, cell A50 is 60 I want it to trigger application A, if 61 then application B etc. So how would I write a Visual Basic program to: check the value of this cell containing my total (which may be, for example, between 60 and 120) and then run the program I have associated with that number? Many thanks |
Visual basic code query
You are welcome! Thanks for the feedback!
Stefi €˛Zakynthos€¯ ezt Ć*rta: Stefi, Many thanks for your help. Best wishes, Tony "Zakynthos" wrote: Ive coded various items of data and assigned values to each item such that when I produce a total I want to lookup a particular cell and check for the total in it and then run a specific program associated with that total. For example, when the total in, say, cell A50 is 60 I want it to trigger application A, if 61 then application B etc. So how would I write a Visual Basic program to: check the value of this cell containing my total (which may be, for example, between 60 and 120) and then run the program I have associated with that number? Many thanks |
All times are GMT +1. The time now is 12:20 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com