Posts by AXBean

    Hello everyone,
    I always think it's going to be easy this time, but then I hit a snag.
    I have created buttons on the ribbon for cut, copy and paste. I know that they already exist, but my clients need everything on one custom tab.
    The macros for Cut and Copy are:

    Code
    Sub Cut()
    Selection.Cut
    End Sub
    
    
    Sub Copy()
    Selection.Copy
    End Sub


    Simple and they work great. But the same process does not work for a PASTE button. Can anyone help me with code for this? Of course, it will be used after pressing the Cut or Copy button.


    Thanks,
    AX

    Hi all,


    I have a macro that is used to split text in one cell into separate columns with a space delimiter. I want the macro to also autofit the columns after they are split, but the Call function I'm using gives me this error:


    Compile Error:
    Argument not optional


    Here is the code I am using:

    Code
    Sub TextToCols(control As IRibbonControl)
    Worksheets("Sheet1").Activate
    Selection.TextToColumns DataType:=xlDelimited, _
     ConsecutiveDelimiter:=True, Space:=True
     Call Autofit_Columns
    End Sub


    And yes, There is a macro called Autofit_Columns in the worksheet:

    Code
    Sub Autofit_Columns
    Dim sht As Worksheet
    'AutoFit All Columns on Worksheet
        Columns.AutoFit
    End Sub


    It's not a big deal to run the macros seperately, but I'd like to minimize clicking.


    Thanks for any help.
    Robert

    I am going crazy looking for what should be a simple Macro to calculate the average of a user-selected range. What I want to happen is:


    1. User selects a column range.
    2. User runs a macro, which calculates the average of the values in the range and places the result in the cell below the range.


    As requested, I have already posted this question here.


    Thanks for any help,
    Robert