public

  1. O

    64 bit issue

    Hi I'm working in 32 bit Excel but I'm getting error in Excel which is 64 bit. How do I edit the codes in 64 bits. Public db As DAO.Database Public rs As DAO.Recordset Public sql As String Declare Function sndPlaySound32 Lib "winmm.dll" Alias _ "sndPlaySoundA" (ByVal lpszSoundName As String, _...
  2. davewatson86

    VBA/SAP help

    Hi all i am trying to automate the creating and saving of invoices as a pdf. so far i have everything working up until it brings up the pdf preview and then i cant get it to work from there. i have done heaps of searching and tried lots of different code but to be honest its a bit out of my...
  3. T

    Initialising a class

    This code: <code style="color: rgb(0, 96, 0);">Option Explicit</code> <code style="color: rgb(0, 96, 0);">Private pKey As Long</code> <code style="color: rgb(0, 96, 0);">Private pName As String</code> <code style="color: rgb(0, 96, 0);">Private pChildren As Collection</code> <code...
  4. D

    Enable Microsoft Scripting Runtime with vba within a Public Sub with Public Declarations

    I have a Public Sub that has Public declarations as Public sdProcess As New Scripting.Dictionary Public sdHeaders As New Scripting.Dictionary I would like to automate the activation of Microsoft Scripting Runtime using this code or something similar...
  5. D

    Updating a formula in excel

    I have a formula that correctly returns if a date is a mon-fri, weekend or public holiday. =IF(A11="","",IF(COUNTIF(Sheet2!$G$87:$DO$97,A11),"Public Holiday",IF(WEEKDAY(A11,2)>5,"Weekend","Mon-Fri"))) I need it to now determine if the day is a mon-fri, saturday, sunday or public holiday. Can...
  6. K

    VBA for Networkdays

    Hi Everyone. I'm still busy with a workbook for our weekly timesheets. I have created a UserForm for the user to fill in everyday. This information will then be sent to the relevant day in the spreadsheet. On top of the UserForm the day of the week as well as the date is displayed. I got the...
  7. spencer_time

    turn sub into function with arguments

    Hello all, I have some code that works in a sub, but I need to use it several times over the course of my spreadsheets timeline. It currently only works on the active sheet, which I also need to change to be the sheet/variable that is called for in the argument when calling the function. This...
  8. K

    Set date for 2 days later

    Hi All, I have a UserForm where the user must enter all the public holidays for the year. In South Africa we have a Public Holiday for the Easter Weekend. The Friday and the Monday is Public holidays. The lazy me, I mean that is why we use Makros, want to automatically add the date for the...
  9. L

    VBA Annotate Pivot Table Modification

    I'm working on implementing VBA code that adds a comment column right after a pivot table. The link below on post #108 is the code I'm using, but my question is what part of the code do I modify to have the comment column(s) be 4 columns after my pivot table instead of the column immediately...
  10. kelly mort

    VBA code to detect mouse movement run a certain code.

    I have a sub that I won't to run anything there is a mouse movement or a key is pressed. It's the stopTimer Sub I found on the web somewhere. So I have this voice code a run periodically. So when I move the move or press a key, then I will like to call the "stiptimer" sub. I will be...
  11. davewatson86

    vba Appliation.onTime Running twice

    Morning/Evening all i have the below code set to update the data in a file every 5 min but it is running the Update sub twice one immediately after the other. i do not have the code (Application.OnTime mTimerTime, "my_Procedure") anywhere else in any other subs so im a bit stumped. where am i...
  12. N

    Type mismatch riddle using class collection

    Hello The code stops at the highlighted line with Type Mismatch if I use oAttendee (or oGuest in the second block), but not if I use oDelegate: Private Sub Create_Attendees() Dim oDelegate As Delegate Dim oAttendee As Attendee Dim oGuest As Attendee Set oAttendees = New...
  13. T

    Compile Error after upgrading form Office 32bit to Office 64bit

    Okay here is the issue. Where I work we updating Oracle SmartView to 64bit but before we do that we have to uninstall MS Office 32 bit and install office 64 bit. I did that and now when he opens the spreadsheet he gets the following message "though Compile error: The code in this project...
  14. O

    Trouble switching between workbooks after Workbooks.Open(sPath)

    I have the following code which appears to get stuck after I open a new workbook (EMEA). I would like to be able to filter the first workbook which is already open (data), and copy and paste between the two. As soon as I open the new workbook, I cannot navigate back to the data workbook and the...
  15. excelbytes

    Object Qualifies

    I am new to VBA. I am trying to change the background color of a text box based on another cell value. I am getting a Runtime error 424 Object required error. Here is my code - what am I doing wrong? Public Sub TextBoxColor() If Worksheets("Sheet1").Range("E1").Value = "Name" Then...
  16. H

    Variable in Textbox Event

    I make a selection in a Userform.Listbox with data coming form the Textbox in a Userform Can I pass a variable to the Textbox Sub ..._Change event ie. Sub TextBx_Change(ByRef ....) I don't want to use a Public variable Thanks
  17. C

    Count Public Holidays that falls on a Saturday

    I have a list of public holidays and I would like to know how I could count the ones that fall on a satuday.
  18. 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...
  19. R

    VBA to Close and Save Workbook on Timer

    Hello, I found code in this forum to close my workbook after a certain amount of time, but when I use it, after closing the workbook, it wants to re-open it. Can anyone provide code that works or help me fix this one? Public RunWhen As Double Public Const cRunIntervalSeconds = 300 ' this is...
  20. B

    Clearing Excel AutoFilter using VBA

    I am using this VBA code to refresh my entire workbook at specific time intervals. As you can see, it is currently set to refresh every 60 minutes. Public RunWhen As Double Public Const cRunIntervalMinutes = 60 Public Const cRunWhat = "Workbook_RefreshAll" Sub StartTimer() RunWhen = Now...

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