private sub

  1. B

    VBA Private Sub for all sheets

    Hello, I have a private sub i am using in a template style sheet, goal is to be able to essentially duplicate this "Template" worksheet and apply unique title and information to the new sheet name. I have all of that down. Here is my problem i have two TextBox's from the developer tab each one...
  2. M

    Preserve data validation input messages when dragging

    I want to be able to retain data validation input messages when dragging the value of one dv cell to another with a different input message. To do this I'm trying to establish a collection of input messages before any edits to the sheet are made so that when I drag a dv cell's value to another a...
  3. K

    Using Multiple Private Sub Worksheet_Change (ByVal Target As Range)

    Hello All, I am very new to VBA and am really hoping someone can help me. I am trying to create a worksheet that hides different rows depending on the drop down responses in various cells ie. please select, yes, no. The first drop down works but when I copy the code for the second drop...
  4. E

    Private Sub to looking at two different cell changes

    Is there a way to have a private sub that runs different macros based on different cell changes? The below code only executes the HideRows macro when I change the value in C11. It will not execute ClearData macro when I change C10. Is there a way to make it work? Private Sub...
  5. A

    Only first Call method is being executed when module is ran.

    Hi, I have module1 which when ran is supposed to: Set variable "template" Call 6 different Sub's with "template" as argument The 6 subs all work perfectly when ran individually but when I try to use the Call method to run them only the first one gets ran, the other 5 never get executed. All...
  6. D

    Help me understand my VBA code please (easy) - thanks!

    Hello everybody, I am currently managing a stock (inventory management) portfolio in Excel. In this, I have my current inventory quantity in column I and two columns in column J & K which I can use to subtract & add amounts from my quantity, so: Column I = Current quantity Column J = Enter any...
  7. L

    Refining date macro to only perform when 4 cells have values in them

    Hi, I am wanting some help to refine this date private sub code. Could somebody please help me include another step so that this sub will only perform if the range in I:L has got data in the cells. Currently it will perform if I put data in the L column. It needs to be similar to an AND...
  8. B

    Need Private Sub Worksheet_Change(ByVal Target As Range) to see multiple tables

    Below is code that works for a single table with one column that has dropdowns that influence another column's drop down lists. The second columns dropdown lists are hosted in a separate tab. I would like to have two tables with the same abilities: Table_Tc and Table_Tc2. How do I add the...
  9. L

    VBA Application.Run of Private Sub Issue

    As usual, this is probably a simple answer, but it is stumping me. I have a couple bits of code that have used for years to ProtectAll, UnProtectAll the sheets for templates. (They are private subs.) That way when I have code to run data imports, etc. I can usually just run the UnprotectAll...
  10. R

    Startup script (workbook_open) doesn't run

    I have a workbook which contains a startup script which works when opening this workbook manually. Now this is a viewer and is sometimes changed by an other VBA script. People who use this viewer sometimes need to refresh this document without saving. The script below is written to reopen the...
  11. S

    Two Cell Change Worksheet Macro - Private Sub Worksheet_Change(ByVal Target As Range)

    Hi, Need help I am new pretty new to VBA, created a worksheet it is working for 1 condition but I tried a lot but unable to make it work for the second condition in the same worksheet. Background: The first code pasted below calls the I need to below code to call a macro when the condition1...
  12. M

    Command Button on Userform not working

    Hello All, I found a macro that creates an outlook appointment, this code works perfectly inside a module. I then copied this code and pasted it inside a command button in a userform, but when I run the form and click on the button, nothing happens as if there's no code inside the button...
  13. D

    Compile error: Expected End Sub

    Private Sub UpdateData() 'Initialise variables strDataAddress = wbNB.Worksheets("Calculations").Range("rDataAddress").Value 'Open data file Workbooks.Open (strDataAddress) Set wbData = ActiveWorkbook Set wsData = wbData.ActiveSheet 'Delete unrequired rows...
  14. T

    VBA Combining Select Case with Private Sub for data management

    Hey guys, so I'm trying to fix a set of data column by column. So for example I have <tbody> Pass Score Age Gender No 40 21 Male Yes 92 19 Female Yes 87 45 Male No 69 60 Female Yes 72 37 Female </tbody> and I want <tbody> Pass Score Age Gender N 40-49 20-25 M Y 90-100 15-19...
  15. A

    Enter value into cell with an InputBox when a radio button is selected.

    I have a worksheet named "Main" that I would like to have an InputBox to pop up when a radio button is selected; (Option Button 3 with value = 1 in cell A311), and have the value of the InputBox placed into cell R2. I have placed the following code directly into the objects sheet but can get it...
  16. R

    Private Sub - run a different macro

    I have the following code: Private Sub Worksheet_Change(ByVal Target As Range)If Not Application.Intersect(Range("BA1:BA3"), Range(Target.Address)) Is Nothing Then Call Part1V1 End If End Sub Sub QPart1V1() Dim CellRangeP1V1 As String CellRangeP1V1 = Range("AX6").Value...
  17. A

    How to call a Private Sub

    So I am trying to create a master macro that will open up different worbooks and run the macros within them. One of the sheets contains a macro that uses a private sub --> Private Sub CommandButton1_Click() The code that I am using to call these macros is....Application.Run ("'AP&AR Impulse2...
  18. K

    Run private sub

    Hi I’m new to VBA, so new in fact that this is my first attempt so please bear with me. I’ve applied the code below to automatically hide inapplicable rows, depending on the value in cell K6. (That value being one of the four possible outcomes of two Combo-box cell-link results -...
  19. cvincent

    Private Sub Worksheet Change by Val looping

    I am not an expert, but managed to create these two vbas that work fine, except that it loops after every single cell change, and I probably need to combine into one vba. I only need to look at C54:D54. The tab color change feature needs to look at cells C54:D54 (not A56), and if the value is...
  20. B

    Worksheet_Change problem

    Hello: Here is my issue... when data is entered into Range("PymtProviders"), I wanted a macro to convert the first two numbers to a number value in an adjacent column Range("PymtOut"). But for some reason, its not working on the Private Sub Worksheet_Change. It does, however, work as a Public...

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
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 "".
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