module

  1. A

    Error 91: Object variable or With block variable not set

    I keep getting the aforementioned error. I have a module (modGlobals) which I use for all public variables... Below seems to be the offending Sub which is in a module. This code is used to populate a list box from entries on a spreadsheet. Sub GetList() If Right(frmMain.Caption, 3) = "V&V"...
  2. D

    For each cntl trigger class module

    Hi I've dynamically created a number of textboxes on a userform. Each textbox was added to a class module with some associated attributes. I also have a number of option buttons to the side of the userform. By clicking the textbox, i can update the text in the textbox from the asociated...
  3. mikecox39

    UDF question: from Chapter 4 VBA and Macros text.

    I'm studying Jelen's book "VBA and Macros" and at the start of Chapter 4, on UDF's, he directs the reader to open a new module in the the VBA Editor and type the following function into the module: Add (Number1,Number2). Can someone tell me what I'm doing wrong because when I enter that line I...
  4. B

    Select a sheet by double-clicking

    Hello, I have a huge workbook with several tabs. I would like to be able to select the tab called "Main" by simply double-clicking anywhere in the spreadsheet. I tried with the code below (ThisWorkbook module) but it does not work :cool: Private Sub Worksheet_BeforeDoubleClick(ByVal Target As...
  5. H

    Module Usage

    Hi - I have a general questions about whether it's best to put all your code into 1 macro, or create separate modules for each procedure and then call them? thanks!
  6. J

    find and replace text within a known module

    Hey all!! I have a form that opens when I open a workbook. I use the form to open another workbook via a drop down list. I use Select Case to open the chosen option. What I'm looking to do is change wording in a module in the first opened workbook. How would I use the Find..Replace method and...
  7. A

    Public Variables -Can They be Referred to by Subs in Multiple Modules?

    I had hoped to be able to declare a variable as public in one module, assign a value to it then refer to it in other modules but as soon as I try to use it in a different module I'm getting "Compile error: Ambiguous name detected" Module 1 Highlights Public Var_DRPS_Code_Version As Variant...
  8. D

    VBA Code to force uppercase text in multiple textboxes

    Hello, I am new to excel an I was hoping to get some help. I have created a userform with multiple text boxes, I would like to force the entered text to Upper case. I currently am using a ucase syntax, but it looks rookie and slows my code down This is what I have so far. Private Sub...
  9. N

    Variable in VBA7

    Hello, I share a lot of generic code between my projects I load a module and it "speaks" immediately with other modules, enum's and type's... sometimes some specific module/enum/type is not on the workbook and I need to comment out a lots of line of code, so I thought to use some kind of...
  10. J

    Excel Book Login and PW question

    Does anyone have any tips on the best way's to protect your workbook with a Login? Maybe an up front Form and Module? Thank you for any help... Johnzea
  11. J

    Pivot table filter reference from cell value

    Hello. I asked a question yesterday in a thread that was from August of 2013: https://www.mrexcel.com/forum/excel-questions/625300-pivot-table-filter-reference-cell-2.html I'd like to ask the same question here in a new post. I used versions of the following code. Code in the Sheet Code...
  12. R

    [VBA] RE GetOpenFileName, I want to point Excel to a file, and then reference that in other modules

    Hi all, Doing a new sheet for reporting, I want to report on a campaign. Let's say our campaign is called "70. London" I use GetOpenFilename to point Excel to this, and then reference that file as 'facml' So now when I talk about facml in that module, it knows the file name and location, so...
  13. C

    VBA Module to automatically work in every excel file

    Hi, I have the following Excel Module that creates a new formula called Findword, Currently I have to press Alt + F11 and add it as a new module everytime I open up a new workbook, is there a way to save it in the background so it can automatically be used in every workbook <code class="vb...
  14. S

    vba code to copy a module

    Is there a way to get a line of code that will copy a module? Idea here being that if I had a line of code that failed, I could have that module copied into a text file, saved in a temporary folder, emailed (with the text file attached), and then the recipient might be able to fix it. I know how...
  15. R

    Need Help with replacing invalid characters in a cell

    I have a column that is basically a description field. It may or may not contain both invalid characters, and hidden, or non-printable characters. I want to use regular expression to remove the invalid characters and replace them with " " (a space). so for example a-z, A-Z 0-9 are acceptable all...
  16. R

    Consolidating Recorded Macros in Personal.xlsb into one Module.

    Greetings All - Happy Friday! Got a pesky one here - (at least for me it's pesky) I have many recorded macros in my Personal.xlsb Workbook using (at least for now) keyboard shortcuts to trigger them When I record these macros the Personalxlsb creates a new module to put it in; which is fine...
  17. JenniferMurphy

    Moving code from one add-in module to another

    I want to move several UDFs from one module in one of my add-ins to another module in the same add-in. I created the new module and moved the code, but now all of the calls to those UDFs get a Name error. From what I have read, this is an addressing problem in that the calls have an invisible...
  18. B

    Cant hide label?

    Hi I have a activex control button. I have this code assigned to it: Private Sub Steg1Ext_button_Click() Call imghidd End Sub I have also tried removing Call and only have imghidd Then i have a module called step1 In that module i have this code Sub imghidd() extinstr1_label.Visible = True...
  19. JenniferMurphy

    Conflict between Code Module and Add-In

    I have a UDF in an add-in module. I decided to make some changes, so I copied it to a code module in a macro-enabled (.xlsm) test workbook. It was all working fine until I closed the test book. When I reopened it, none of the calls to the UDF were getting executed. They all showed a Value error...
  20. R

    Starting to hate Excel - Making -any- change to the VBA breaks this, for some reason

    Have the following code in a module: AdSelect.LDAlts = "---A---" & Chr(10) & Cells(ActiveCell.Row, "F").Value & Chr(10) & Chr(10) & "---B---" & Chr(10) & Cells(ActiveCell.Row, "G").Value & Chr(10) & Chr(10) & "---C---" & Chr(10) & Cells(ActiveCell.Row, "H").Value If I open the workbook and...

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top