Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want to store multiple values in Column A and VBA Conditional Code in
Column B. The Conditional Code is just text and is just stored on the worksheet. When a macro is run and a variable equals the value in column A then the code stored in Column B executes inside the macro. For example, A1 = "ALLEX" and B1 = "If Not Left(route,1) = "K" . So, when the macro runs and checks to see if "ALLEX" is in Column A. If so ,then it will use the associated Condition: If Not Left(route,1) = "K". directly in the Macro. So, if both conditions are true, "ALLEX" is found and Not Left(route,1) = "K", then do something. I could "hardwire" that conditon in the Macro, but there can be many different Values in Column A with different conditions and I want the ability for the User to add values / conditions thru a User Form rather than directly updating the VBA Code. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() There's an Execute statement I ran into that can interpret a character string as VB code...but no, that's available only in VBScript. What is the possible range of conditions that might be in col B? And is route a VBA variable name, or something in a spreadsheet somewhere? --- "Bruce" wrote: I want to store multiple values in Column A and VBA Conditional Code in Column B. The Conditional Code is just text and is just stored on the worksheet. When a macro is run and a variable equals the value in column A then the code stored in Column B executes inside the macro. For example, A1 = "ALLEX" and B1 = "If Not Left(route,1) = "K" . So, when the macro runs and checks to see if "ALLEX" is in Column A. If so ,then it will use the associated Condition: If Not Left(route,1) = "K". directly in the Macro. So, if both conditions are true, "ALLEX" is found and Not Left(route,1) = "K", then do something. I could "hardwire" that conditon in the Macro, but there can be many different Values in Column A with different conditions and I want the ability for the User to add values / conditions thru a User Form rather than directly updating the VBA Code. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm not sure what the possible range of conditions will be. The values in
Column A and the conditions in Column B will be added / edited by the User, thru a User Form, as new conditions are discovered. Yes route is a VBA variable of type string. The VBA code checks to see if a point from column A is in the route. If so, and the condition in Column B is true, then I want to remove it from route. Thank you for your time. "Bob Bridges" wrote: There's an Execute statement I ran into that can interpret a character string as VB code...but no, that's available only in VBScript. What is the possible range of conditions that might be in col B? And is route a VBA variable name, or something in a spreadsheet somewhere? --- "Bruce" wrote: I want to store multiple values in Column A and VBA Conditional Code in Column B. The Conditional Code is just text and is just stored on the worksheet. When a macro is run and a variable equals the value in column A then the code stored in Column B executes inside the macro. For example, A1 = "ALLEX" and B1 = "If Not Left(route,1) = "K" . So, when the macro runs and checks to see if "ALLEX" is in Column A. If so ,then it will use the associated Condition: If Not Left(route,1) = "K". directly in the Macro. So, if both conditions are true, "ALLEX" is found and Not Left(route,1) = "K", then do something. I could "hardwire" that conditon in the Macro, but there can be many different Values in Column A with different conditions and I want the ability for the User to add values / conditions thru a User Form rather than directly updating the VBA Code. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
formula to place real time in a cell when data entered in an adjacent cell | Excel Programming | |||
Storing real time data into Sql Server | Excel Programming | |||
Scatter chart for real-time tracking of a single cell value ? | Charts and Charting in Excel | |||
storing real time data | Excel Discussion (Misc queries) | |||
Showing length of active cell in real time | Excel Programming |