private sub

  1. 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...
  2. 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...
  3. 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...
  4. 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...
  5. 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...
  6. 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...
  7. 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...
  8. 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...
  9. 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...
  10. 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...
  11. 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...
  12. 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 -...
  13. 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...
  14. 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...
  15. L

    ActiveX Control Checkbox and VBA

    hi all, i'm facing this issue i have activex control checkbox which is check automatically with private sub if some conditions are met but if there are no conditions I'm not able to manually check checkbox, because private sub keeps looking at the condition and keeps unchecking it. is it...
  16. B

    Private Sub/worksheet change/hide rows

    Hello: The following code was working for me, but, for some reason, it has stopped. Does anybody note any flaws?
  17. S

    use/ reference VBA Worksheet event in module for use in all workbooks

    Hi there, I'm very new to VBA, first of all, so thank in advance for patience. I have this code saved to "ThisWorkbook" on my PERSONAL workbook: Private Sub Workbook_SheetActivate(ByVal Sh As Object) MsgBox "Name of Sheet : " & Sh.Name End Sub it works fine when I'm within the PERSONAL...
  18. J

    VBA Private Sub - How to use DATEVALUE in a VLOOKUP

    I am trying to get a DATEVALUE from another worksheet by using Vlookup. The reason for this is the worksheet I am trying to Vlookup from is not storing the dates as dates and I am unable to simply change the data into a date format as it is 'controlled' by someone else. Currently, the...
  19. J

    Is there a way to stop 1 macro activating another macro

    Is there a way to stop a macro activating a Worksheet_Change sub? I need the macro to not activate the Worksheet_Change sub as it causes the macro to take a long time to run. Any help would be much appreciated! Thanks J
  20. U

    Combine two Private Sub Worksheet_Change - VBA Macro

    Hi everyone! Thanks for reading first of all. I have these two Private Sub Worksheet_Change(ByVal Target As Range) that work fine alone in one sheet, but if I put both together I get errors. I read that they need to be combine into one so there is only one Private Sub Worksheet_Change(ByVal...

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top