Call Modules Based On Choice?

Jul 11, 2013

I have two different modules in my automation - to be specific one module to convert file from LH to RH and another module to do the reverse - convert RH to LH.

I have put up a radio button choice for the user and based on which radio button is selected would like to run that particular module.

Below is my code. It always throws an error "expected variable or function not module"

VB:
Option Explicit
Public Sub MAIN()
If ThisWorkbook.Worksheets("FRONT").OptionButton1.Value = True Then
Call LH_to_RH

[Code]....

I am following the correct procedure to call modules. A few minutes of search said the modules have to be public sub routines

View 2 Replies


ADVERTISEMENT

Call Modules From Array?

Sep 14, 2012

I have a number of modules that I want to call is it possible to call them from an array

For example

myarray = Array("Outstanding_Per_Agent", "Unique_Records")

Call myarray

This doesn't work as it says it expects a sub function or property

Do I need to define "myarray" as something or is it even possible.

View 2 Replies View Related

VBA - Call Macros With Varying Names And On Varying Modules

Oct 2, 2013

I want to call a macro with a varying name that is within a module with the same name.

I have a module called Test1 and within this, a macro name called test1
I have a module called Test2 and within this, a macro name called test2
etc

On another module called Test8 (with the macro called Test8), this Test8 macro will call either Test1 or Test2 or Test3 etc depending on what I choose in an excel spreadsheet. So on sheet1, cell A1, there is a drop down with the options Test1 or Test2 or Test3 etc.

The following works to run the macro test1 from module test1 (when it does not vary i.e. i physically put in the name of the macro myself):

Sub Test3()
Test1.Test1
End Sub

The following works to run the macro test2 from module test2 (when it does not vary i.e. i physically put in the name of the macro myself):

Sub Test3()
Test2.Test2
End Sub
etc

However, if I try it so that the calling of the macro varies as below , it does not work:

Sub Test3()
MacroToCall = Sheets("Sheet1").Range("A1").Value
MacroToCall.MacroToCall
End Sub

View 7 Replies View Related

Lookup Data For Drop Down List Choice & Show Blank If No Choice

Feb 6, 2008

I currently have a drop down menu in one of my worksheets, in which I have several different text values entered. What I would like to do is link each of those text values to a numerical value, which would be entered in to another cell. So if I select "Option A" from my drop down list, and Option A is equal to 200, I want "200" to show up in another cell. If I select "Option B" from my drop down list, and Option B is equal to 400, I want "400 to show up in that same other cell.

View 4 Replies View Related

Distribute Names To Lesson Choice Table By Choice Priority

Dec 7, 2013

I want to make a lesson table which distribute the names to lesson choice priority.

You can see detail and explanation at attached file. LessonChoice.xlsx‎

View 3 Replies View Related

Removing Selection / Choice From Listbox Once Choice Has Selected

May 8, 2013

I have a worksheet that has 8 activex listboxes. Each listbox is tied to the sames list of values (identified as a named range). The named range is a list of countries. Each country should only be selected once, therefore, I would like the selected country(ies) to not show up as a choice when the user makes a selection from another listbox. If this is too hard, maybe we can get a msgbx to appear anytime the users tries to select a country that has already been selected.

View 3 Replies View Related

Fill Drop Down Based On Choice From Another

Aug 15, 2008

What I want to do is lets say in the drop down menu I have options Food, sports, Movies. now if I select Sports then it should give me a sub caterory options like baseball, hockey, football and not the options for food & movies as well - so as to make the choices lesser and more user friendly. How do I create that - is it too tough - I am a novice in excel. Can you upload an example sheet with tips on how you did it. I have uploaded an example.

View 3 Replies View Related

Result Based On ComboBox Choice

Jul 25, 2006

I'm looking to set up a combo box with different year options and add functionality so the data that can be seen on the sheet at a given time is driven by the combo box year value. (functionality somewhat like a webpage, where once you choose a certain value from a drop down box, you see data corresponding to the value)

View 9 Replies View Related

Run Macro Based Combobox Choice

Jul 13, 2007

I'm using a ComboBox ,ComboBox2_Change(), to Call and run 1 of 4 different macros. It works fine if I choose a different item in the list each time, but if I choose the same one, it won't run the macro a second time.

View 5 Replies View Related

Go To Sheet Based On ComboBox Choice

Aug 22, 2007

I have a combo box that I have populated with choices (months of the year). I require users to select the month they wish to view their payslip with and then press "Go" (a command button) and jump to the worksheet that contains their payslip info. How do I get VBA (Excel 2007) to do this please? I have tried on the CommanButton1 code page to type

If combobox1.value = "May" Then Goto Worksheets("Sheet3")

This doesn't work and I know I'm doing something wrong as I remember when I was doing my project at school you had to give each combobox selection a value like 0, 1 or 2 but I cannot remember how to do that!

View 6 Replies View Related

Drop-Down List To Be Based On Choice Of Another

Apr 23, 2008

I have a drop-down box(K6) When a style is selected I need to have data show up in other drop-down boxes (H3,L3,P3) These selections would only pertain to the selection in K6. They would change when a different style is selected. There are multiple choices in the secondary drop-downs. [IMG][/IMG]

View 9 Replies View Related

Drop Down List Based On Choice From Another

May 1, 2008

What I need to do is create a Drop Down box. When a user makes their selection it gives another drop down box from what they selected. Each choice in the 1st drop down will give a different drop down box in the next field from what they selected in the 1st. I am having troubles getting this to work.

View 3 Replies View Related

Filter Table Based On Choice In Another

Jun 22, 2008

1. I am starting with two independent tables, one with ‘ItemA’ and the other with ‘ItemB’

2. The user must be able to select an itemA which will point to itemB list, showing only a specific pre-defined group or combination of the itemBs.

3. This pre-defining of the itemB combination will be done uniquely for each itemA selection

Example: Selection of an itemA, row 2 will show, say, an itemB rows 2, 4, & 7 only. Selection of itemA, row 3 will show an itemB rows 4, 5, & 9 only. Selection of an itemA, row 4will show an itemB rows 2, 7, 11 & 13 only, etc.

4. In reverse, the user also needs to be able to select an itemB and display all itemA’s common to that itemB. Using the example above, the entry or selection of an itemB, row 2 will show rows 2 & 4, itemA.

This is represented visually in the attached GIF.

View 5 Replies View Related

Conditional Summation Based On Drop-Down Choice

Dec 2, 2009

I have attached a spreadsheet that I need to automate. Cell C3 is a drop down box of the raw data found on the raw data sheet. I would like B6-8, c6-8 and d6-8 to automatically updated and change depending on what users select from the drop box in C3. (so basically im trying to re create the yellow table with formulae/ vb.)

View 4 Replies View Related

Return Value Based On Validation List Choice

Nov 14, 2006

I have created a cascading data validation list, and I would like to have an adjacent cell auto populate according to the dropdown selection.

Data Eg:

Oranges 1100
Apples 1101
Pears 1102
Grapes 1103

If the user selects "Pears" from the dropdown list, I would like the adjacent cell to populate with the numerical code for "pears", in this case 1102. I am designing a new expense report form at the office, and I am at a standstill with this problem.

View 2 Replies View Related

Filter & Copy Based On ComboBox Choice

Nov 14, 2006

I have 2 work sheet

First sheet is "Department "
11 Departments

Second sheet is "Designation "
20 Designation

i have generated VBA form
but..now in this form i want to create 2 input options..

1)select department (capture all depts. from Department sheet. if i select HR Department then in 2nd option all HR Designation should be copied

View 4 Replies View Related

Disable TextBoxes Based On ComboBox Choice

Nov 22, 2006

I have three textboxes (16,17,18) that need to be disabled if a certain value ("Regular Hours") is in combobox1. Would I use an If statement? Also, is there a way to "gray out" the textboxes to show they are disabled?

View 6 Replies View Related

Select Column Based On ListBox Choice

Nov 27, 2006

If I've Listbox1 in "ABC.xls" which contain selected headers of workbook "XYZ.xls".

How can I select entire columns in workbook"XYZ.xls" when press enter at Listbox ?

Do I've to put the code here ?

With Me.ListBox1
For i = 0 To .ListCount - 1
If .Selected(i) Then

? ? ?

End If
Next i
End With

View 4 Replies View Related

Lookup In Table Based On List Choice

Aug 22, 2007

I have a way of getting a cell value from having a data validation linked to a row of cells containing lookup formulas.. which in turn are looing at a table.

I have attached a small example.

The problem is the spreadsheet is a large one and i was hoping I could shrink the size of this by removing the vlookup formulas by having some kind of index/match/lookup formula inserted directly in the data validation.

I got this to work using nested IF formulas but its not very practicable!

The attached example has data validation in column A that selects the task type. Choosing this then changes the values in the vlookup area.. which then becomes the validation list for cell in column B.

View 9 Replies View Related

Run Macro Based On Validation List Choice

Sep 3, 2007

I'm looking for a method, vba macro or Excel code, to preform the following task:
In the C column the user chooses one of several options from a menu, let's call these options 1 - 10 (this part is already done). Depending on the choise, different things are supposed to happen:

For 1-9, the formulas for cell A - Q on the current row should be copied to the next row (but with +1 in row number in formulas of course).

For 10, 3 blank rows should be created (well they already are blank..), on the forth row down, A3 - Q3 should be copied exactly. On the fifth row, the same formulas thing that was created for choise 1-9 should be created.

Since the real xls-file is too big already and it contains some sensitive information, I can't attach it here, but I made a small and similar xls-file, that better explain what I want to do.

View 8 Replies View Related

Auto Fill Based On Drop-down Choice

Dec 13, 2007

I'm working on a workbook that already exists and that contains multiple worksheets (A,B,C,D,...), each with specific info (each row consists of an item name (item 1, item 2, item3,...)and all characteristics of this item).

We now want to add a help page for each worksheet :
A => A help
B => B help
...

So for each item (=row) in sheet A, there should also be an according row with additional info in A help

First, I used static hyperlinks to switch from the item in A to the corresponding help in A help. However the item list can be extended in the future (meaning rows inserted) and this will cause these links to fail. Therefore I switched to dynamic hyperlinks by inserting names (in stead of the original cell names) for each item in both A and A help. This involves a lot of work since you have to give all the involved cells a unique name and you have to refer to this unique name when you set up the hyperlink.

View 2 Replies View Related

Go To Range & Sheet Based On Combobox Choice

Feb 2, 2008

3 work sheets nameWorksheets "InfoData" to save month NameWorksheet "Jan" for JanuaryWorksheet "Feb" for February1 x ComboBox = monthBox
4 x CommandButton = Week1Button,Week2Button,Week3Button,Week4Button
---------------
I have Problem opening worksheet from userform. Name of the months are in Combox. So when I select month January from comboBox and click on Week 1 command Button it should open worksheet named "Jan" and Select Cells(2,1) to show Week 1. And Same for week 2, week 3 and week4 but will select different Range or cells. I have attached the screenshot of userform and also the workbook.


Private Sub Week1Button_Click()

For i = 1 To 13

If monthBox.Value = Worksheets("infoData").Cells(i, 1) Then

Worksheets("jan").Range(2, 1).Select

End If

Exit For
Next i

End Sub

View 9 Replies View Related

Function To Return Value Based On OptionButton Choice

Feb 3, 2008

Ihave 2 functions which are called in my main program which should return a value due to what the user selects on a userform using option buttons and check boxes.

Function getnum() As Integer
If userform1.OptionButton1.Value = True Then
getnum = 1
End If
If userform1.OptionButton1.Value = True Then
getnum = 3
End If
If userform1.OptionButton1.Value = True Then
getnum = 5
End If
End Function

Function getlevel() As Double
If userform1.CheckBox1.Value = True Then
getlevel = 1.2
End If.......................................

View 3 Replies View Related

Return Data Based On Drop-Down Choice

Feb 12, 2008

My Main data in my workbook is copied from another workbook. From there it is sorted into separate worksheets for each customer via a macro. I want to be able to set something up so that I can list the customers and then list job descriptions, products and pricing from the correct sheet and return the selected data back to its original form in sheet1.

I am also trying to run the macro that sorts the data in this workbook from another workbook.

I have attached the file so you can see what i am trying to explain.

View 9 Replies View Related

Run Macro Procedure Based On Drop-Down Choice

May 15, 2008

I have a worksheet with 7 macros each run from a seperate button. I would like to tidy up the sheet by having a combo box containing a description of each macro and one button to run the macro currently shown in the box.

View 4 Replies View Related

Sumif Referencing Range Based On Choice From Dropdown?

Mar 8, 2014

I have several different named ranges that I want to sum and the user chooses the range from a drop down box. I want to select the range based on that choice but when I reference the cell that contains the reference to the selected range I get a result ** 0, but no error. I realize I could use several nested "If" statements but I was looking for a more streamlined approach.

here is the formula:

=SUMIF(Regions,B4,worksheet!K13) K13 = the name ** the selected range.

if I put the name ** the range directly into the formula I get the correct result.

View 3 Replies View Related

Data Validation And Multiply Values Based On Choice

Mar 11, 2014

I've got a spreadsheet and I've used data validation to look at a list on another tab.

I need to be able to multiply values out based on what i choose on the drop down menu.

I've attached a sample spreadsheet to explain : tasks.xlsx‎

View 3 Replies View Related

Multiple Choice - Select A Value Based On Its Probability Of Occurring

Dec 24, 2009

I have the following table:

http://img85.imageshack.us/i/tableb.jpg/

Each question is multiple choice (either A/B/C/D/E) and the values listed are the probability of each letter occurring. What formula would I need to put in the 'output' column for it in each row to output a letter based on the probabilities. E.g. in question 1, most of the time it would output E, but sometimes (rarely) A and very rarely B/C/D.

View 9 Replies View Related

Charting Data Based On Dropdown List Choice?

May 28, 2011

Charting Data Based On Drop Down List Choice

I am trying to build a report where I can chart data base on a dropdown selection.I did build the dropdown lists, however I don't have any expertise on execel functions in order to make it work.I am attaching my draft report.

View 6 Replies View Related

Perform Action Based On Choice From Validation List

Sep 22, 2009

In all the cells in column F I have a validation list with several predefined choices, but at the bottom of this list I want an "Other..." option, which when chosen, enables the user to enter a new string in that cell if none of the predefined did not match.

View 7 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved