Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. MigrantFirmWorker

    Excel 2013 VBA: error on UserfForm1.show

    As a test, I created a userform called UserForm1 in a workbook. In the same workbook, I placed an ActiveX button on Sheet1. In the code for Sheet1 I placed: Private Sub CommandButton1_Click() UserForm1.Show End Sub When I click the button, the form appears. Are you doing anything...
  2. MigrantFirmWorker

    Excel 2013 VBA: error on UserfForm1.show

    Where does UserForm1 reside? Is it in the workbook with the command button, another workbook, or an add-in? Chris ------------------------------------------------------------- "Don't be deceived. We're all temporary employees.
  3. MigrantFirmWorker

    Excel 2013 VBA: error on UserfForm1.show

    Try using Me.Show instead of UserForm1.Show Chris ------------------------------------------------------------- "Don't be deceived. We're all temporary employees.
  4. MigrantFirmWorker

    Running VBA on a locked computer

    Does anyone know how to get VBA macros to continue running after the computer has been locked? I have macros that I would like to run overnight but the computer must be locked in my absence. As far as I can tell, execution pauses when I lock the machine and resumes when I unlock it. Chris...
  5. MigrantFirmWorker

    Excel select and copay and past to another sheet

    I see that your row index variables are defined as Integer. Integer is limited to a max value of 32,767. If you have more rows than this it will fail. Use Long for row indices. Dim LSearchRow As Long Dim LCopyToRow As Long Chris...
  6. MigrantFirmWorker

    Error 91 when trying to Set variable = Range

    I just noticed something else, unrelated, in your code. Dim LastRow, i As Long is equivalent to Dim LastRow as Variant, i As Long if your intent was for both to be Long you must explicitly define them both. Dim LastRow as Long, i As Long Chris...
  7. MigrantFirmWorker

    "OnFocus" event for Excel Userforms?

    Thanx for all the assistance. Strongm's code was particularly helpful. I never would have figured this out on my own. It turns out that capturing the form's Activate/Deactivate messages didn't quite get me what I needed. They are only sent when changing applications, not changing focus...
  8. MigrantFirmWorker

    Error 91 when trying to Set variable = Range

    You have a typo: Set asANI should be Set wsANI. asANI is actually referenced in multiple places, just not in the "Set tblr" line. I find that using OPTION EXPLICIT greatly reduces these errors. Good luck. Chris ------------------------------------------------------------- "Don't be deceived...
  9. MigrantFirmWorker

    "OnFocus" event for Excel Userforms?

    It's a rather simple application. I keep having a need to copy curves from one graph to another...sometimes on the same worksheet, sometimes to a different workbook. I select a curve on a graph, press "Copy Curve", then store as many of the relevant parameters as necessary. I then select the...
  10. MigrantFirmWorker

    "OnFocus" event for Excel Userforms?

    Ultimately I'm trying to set the Enabled state of the controls on the form based on conditions on the active worksheet, and doing that in an "OnFocus" event handler is the approach I use in other languages. I was hoping I could possibly set up a custom class for the form "With Events" but I...
  11. MigrantFirmWorker

    "OnFocus" event for Excel Userforms?

    Sequence of events: 1) I run the macro that displays the form on the desktop. 2) UserForm_Initialize() & UserForm_Activate() are fired and the form has focus. 3) I select a cell in the worksheet, the form loses focus, the worksheet gains focus. UserForm_Deactivate() is not fired. 4) I click on...
  12. MigrantFirmWorker

    "OnFocus" event for Excel Userforms?

    BTW - this is a modeless form. Chris ------------------------------------------------------------- "Don't be deceived. We're all temporary employees.
  13. MigrantFirmWorker

    "OnFocus" event for Excel Userforms?

    Yes. They aren't being fired when the focus changes. Chris ------------------------------------------------------------- "Don't be deceived. We're all temporary employees.
  14. MigrantFirmWorker

    "OnFocus" event for Excel Userforms?

    I need to know when my UserForm has gained or lost focus. I haven't found an obvious way of capturing these events. The closest things I've found are the Enter and Exit events for individual controls, but not the UserForm itself. Any ideas? Chris...
  15. MigrantFirmWorker

    Buttons on worksheet opies always point to macros in orignal worksheet.

    Perfect! Thanx. Chris ------------------------------------------------------------- "Don't be deceived. We're all temporary employees.
  16. MigrantFirmWorker

    Buttons on worksheet opies always point to macros in orignal worksheet.

    So far, my options haven't changed from when this first came up. 1) I can have the user manually reassign the button on the new worksheet. 2) I can place the macro in a module and force the user to copy it along with the worksheet to any new workbooks. 3) I can add another macro to automate the...
  17. MigrantFirmWorker

    Buttons on worksheet opies always point to macros in orignal worksheet.

    I may be missing something here. I'm not using any code for the copy operation. I'm merely trying to set up the worksheet such that a user can move or copy it within, or between, workbooks without having to reassign the macro to the button. Chris...
  18. MigrantFirmWorker

    Buttons on worksheet opies always point to macros in orignal worksheet.

    No luck. It seems to want a hard reference to a worksheet (workbookName.xlsm!Sheet1.macroName), or just the macro name from a resident module. Chris ------------------------------------------------------------- "Don't be deceived. We're all temporary employees.
  19. MigrantFirmWorker

    Buttons on worksheet opies always point to macros in orignal worksheet.

    I have an Excel worksheet with a macro embedded in it (not in a module). This macro is invoked by a button on the worksheet. When I copy the worksheet, the macro and button are copied with it, as intended. Unfortunately, the button on the copied sheet points to the macro in the original...
  20. MigrantFirmWorker

    Problem with dynamically generated arguments in callback function

    Thanx. Chris ------------------------------------------------------------- "Don't be deceived. We're all temporary employees.

Part and Inventory Search

Back
Top