private

  1. L

    How to skip 'Compile error in hidden module' error message

    I have a workbook that was written in 32bit Excel and I'm trying to upgrade these sheets to work for 64 bit excel. The code that I need l find and replace is the following: find = "Private Declare Function", replace = "Private Declare PtrSafe Function". Problem is when I open the 32 bit sheet I...
  2. K

    .xl01 file type

    I have a program that opens an existing workbook, adds a date to the name and saves it as a new file. The code says to save it as a .xlsm file type but it ends up as a .xl01 or a .xl04 or a .xl010 file type. Excel does not recognize this file type when attempting to open in explorer. I cannot...
  3. N

    How to set Macro1 invisible to the user?

    I have an ActiveX button on the Index worksheet. By clicking on this button i want to call two VBA macros In Module1 exists Macro1 = Import multiple specific sheets from all files in folder Macro2 = List all sheets on Helper sheet in active wokrbook However, I do not want the user to see these...
  4. L

    2 forms

    Hi I have 2 forms. UserForm1 and UserForm2. Do I need to say UserForm2.Label1.Caption or just Label1.Caption I did "Label1.Caption" and everything work fine, it is not effecting the UserForm1 The code below is for UserForm2 Private Sub myadd_Click() UserForm2.Label1.Caption =...
  5. B

    Need help with runtime error 6 overflow

    Hi Everyone, I am getting a runtime error(runtime error 6 overflow) when selecting ALL cells in a worksheet. This sheet has a pop up calendar referencing cell J3. Debug shows the error in the second line of the code below. Any idea why? Thank you! Private Sub Worksheet_SelectionChange(ByVal...
  6. R

    Logic Eluding Me (OptionButtons)

    Hi Folks, I'm trying to get a process involving OptionButtons to work, but the logic is eluding me (been struggling with it on & off for several days). I'm hoping someone here can help/nudge me in the right direction... On a UserForm, I have a Frame containing several (10) OptionButtons. The...
  7. H

    CutCopyPaste mode - will not deactivate

    Hi all, I'm sure this is a simple fix, but I have a code to turn off the past options, however they do not reactive once clicked off that workbook and remain activated on all other books. Can anyone explain my error? :confused: Private Sub Worksheet_Activate() Application.CutCopyMode = False...
  8. E

    Private Sub - range for every sencond column

    Hej guys. I have this little problem. I would like to make it the same for every second row, but i cant figure out how to set the range correctly. I want to type "x" in a random cell i column D or F, and the timesample will emerge one the cell to the right. Private Sub Worksheet_Change(ByVal...
  9. H

    Disable right click, Ctrl+V and Paste option in Ribbon

    Hi, I wonder if anyone can help. I'm no expert at Excel and I have been cobbling together different parts of VBA to disable the following; Right Click Ctrl+V Paste option in the Ribbon It doesn't appear to be working (I am currently doing this in Microsoft Excel on a MacBook, but the code...
  10. B

    running private sub from another form

    Hi all, I have two forms; frmTelephoneSearch and frmAddNewContact On frmTelephoneSearch is a button that opens frmAddNewContact in frmTelephoneSearch i have a private sub named; UserForm_Initialize() I got a button on frmAddNewContact with this code in it; Private Sub...
  11. M

    Excel crashing during VBA procedures

    I have a module called UpdateCheck with procedures which check another document to see if the version number has changed. If it has, it asks the user if they want to update the document to the new version. This is only to update the modules because the formatting of the worksheets is set in...
  12. T

    VBA to close WIndows Explorer

    According to this thread: https://www.mrexcel.com/forum/excel-questions/1048556-vba-close-windows-explorer-window.html this code closes a session of Windows Explorer: Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As Any, ByVal lpWindowName...
  13. J

    Private Sub Worksheet_SelectionChange(ByVal Target As Range): by color?

    Hi Excel-experts,i find this code on internet: Private Sub Worksheet_SelectionChange(ByVal Target As Range)Is it possible to run anything like this, but then for 'Colour change in cells'? I would like my sheet to react on change of backround colour in some specific cells. Thanks in advance, Johan
  14. S

    VBA to prevent CUT & Paste function, but allow copy

    Hello I have the code to prevent CUTCOPYPASTE I need copy to work, because I need to copy the data to outside of excel. Private Sub Workbook_Activate() Application.CutCopyMode = False Application.OnKey "^c", "" Application.CellDragAndDrop = False End Sub Private Sub Workbook_Deactivate()...
  15. hatman

    Withevents in Runtime Created Userform

    I feel like I am missing something here. I use Class Modules to hook events of runtime created controls in design-time created forms. When I copy the resulting architecture to a new project, I wind up dragging a Form (that may be empty) plus a Class Module into the new file. That's fine, but...
  16. R

    Taking ranges and filtering out outliers (reducing the size of the range)

    I have a userform that displays a graph. The userform has some private member variables through which certain data is passed, Option Explicit '--userform module variables Private msAxisTitle As String 'accepts axis title Private msCaptionForGraph As String 'accepts caption...
  17. J

    Userform with input numerical number with listbox

    Hi, I found this code: Private Sub Worksheet_SelectionChange(ByVal Target As Range) Application.EnableEvents = False On Error GoTo exitHandler If Target.Column = 10 Then gCountryListArr = Sheets("RESOURCES").Range("Table2[COD]").Value gCellCurrVal = Target.Value...
  18. R

    Titleless UserForm: Code in wrong(?) Modules...

    Hi Folks, I've been trying to adapt some code from a VBA book, but I can't seem to get it right (most likely because it's all Ελληνικά to me... :oops: ). The code is for a title-less UserForm. Examples are abundant on the Web, but I haven't (yet) found one that does what I'd like to do, the...
  19. S

    Closing UserForm with Cancel commandButton

    My form has multiple text boxes and a combolist. Two buttons on the bottom, one for adding info into the spreadsheet, one for cancelling. When I click the cancel button, I get a 'Runtime error 91': Object variable or With block variable not set. My code is below. What am I doing wrong? Private...
  20. A

    UserForm Resize

    I found the following with pretty much does what is wanted - 'Written: February 14, 2011 'Author: Leith Ross ' 'NOTE: This code should be executed within the UserForm_Activate() event. Private Declare Function GetForegroundWindow Lib "User32.dll" () As Long Private Declare Function...

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