Posts by mjschukas

    i would like to retain the focus of the current cell before the user clicks on a button to run a macro (see below) to open a userform...?


    Code
    userform.show


    (the cell focus seems to disapper...after the button is clicked, but does stay on the cell when i run the macro from tools macros...)


    ???


    thank you...

    i'm using the following code to force saving a file into a predetermined path and folder...


    sometimes, the user accidentally uses a "special character" in one of the cells and the file won't save...


    i would like to have an error message, alerting the user to this problem (and ask them to rename and save again...)...


    ???



    thank you...

    after one selection is made, i would like the focus to go back to the combobox and select the next item and be ready for the next search and selection (i.e., search by first letter mode)...?


    i'm using the following code without "perfect, consistent" outcomes:


    Code
    ComboBox1.SetFocus
    With ComboBox1
           .SelStart = 0
           .SelLength = Len(.Value)
       End With
    ComboBox1.EnterFieldBehavior = fmEnterFieldBehaviorRecallSelection


    ???


    thank you.

    Re: Passing Variables Within Procedures On A Worksheet...


    thank you...


    i added to the top of my vba editor for the sheet:

    Code
    Public MyRow As Variant
    Public Mycol As Variant


    ...the variables have the values when i click lblGoToMaterials, but they are empty when i click cmdGoBackTo...


    ???


    thanks...

    passing variables within procedures on a worksheet...


    i have:

    Code
    Private Sub lblGoToMaterials_Click()
    'email to:
    '----------------
    'grab current position
    myRow = ActiveCell.Row
    mycol = ActiveCell.Column


    and i would like to pass the values gotten in myRow and mycol to:

    Code
    Private Sub cmdGoBackTo_Click()
    Application.Goto Reference:="R" & myRow & "C" & mycol


    ???


    thank you...

    the following macro works great if there is data below cell O4...
    but is there isn't any (e.g., at the beginning), then the cursor runs down to 65,536...


    ?if no data exists, how can i stop at cell O5...


    Code
    Range("o4").Select
     'Range(Selection, Selection.End(xlDown)).Select
     Selection.End(xlDown).Select
     ActiveCell.Offset(1, 0).Activate

    i can run this code as a macro, but i get an error "1004" when i run under a command button...?


    Code
    Range("A2:H36").Select
        Selection.Copy
        Sheets("Letterhead").Select
        Range("A8").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False


    ???


    thanks...

    Re: Surpressing Error Message


    thank you...


    ?is this enough of the code...?


    thank you...!

    i'm coping a file over itself and i get an information message
    "File cannot be copied onto itself" - An attempt to copy a file could not be completed because the file already exists or same source and destination.


    i would like to surpress this, i have tried the following, but to no avail:


    Code
    Application.DisplayAlerts = False
    Application.ScreenUpdating = False
    Application.Interactive = False


    ???


    thank you...

    Re: Compress Worksheet File...


    thank you...i like the idea, but the error message still pops up...


    seemingly during the following code (when it finds a previous compressed file):


    Code
    oApp.Namespace(FileNameZip).CopyHere oApp.Namespace(FolderName).items
        'Keep script waiting until Compressing is done
        On Error Resume Next
        Do Until oApp.Namespace(FileNameZip).items.Count = oApp.Namespace(FolderName).items.Count
            Application.Wait (Now + TimeValue("0:00:01"))
        Loop

    Re: Compress Worksheet File...


    some progress...! thank you...


    i would now like to surpress the request "the folder already exists..."?


    Code
    Set oApp = CreateObject("Shell.Application")
            'Copy the files in the newly created folder
            oApp.Namespace(FileNameFolder).CopyHere oApp.Namespace(fname).items


    ???


    thank you.

    Re: Compress Worksheet File...


    thank you...


    i'm trying not to use winzip, etc.


    but maybe, i can compress to a different folder, copy into the folder i need to, and then delete the old file...!


    i will try on monday and get back asap...


    thank you..!