none
Mac office 2016 Excel VBA Copy Paste code error RRS feed

  • Question

  • Hi

    I've created a VBA code on Windows for compile a data and remove the blank cells by filtering data, and then copying the cells with values and pasting over to another area of the same sheet. All the references are on the same sheet/workbook but it copies and pasts two columns at a time and pasting both instead of only one at a time.

    Below is the code where error is occurring. Also on the next step it doesn't go to the Print Preview stage somehow.


    Sub Print_Estimate()
    '
    ' Print_Estimate Macro
    '

    '
        Range("Q14:Q31").Select
        Selection.Copy
        Range("D77").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=True, Transpose:=False
        Application.CutCopyMode = False
        Range("R14:R31").Select
        Selection.Copy
        Range("K77").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=True, Transpose:=False
        Application.CutCopyMode = False
        
        
        Range("B54:L130").Select
        ActiveSheet.PageSetup.PrintArea = "B54:L130"
        ActiveWindow.SelectedSheets.PrintPreview
        Range("C12").Select
    End Sub

    Thank you.

    Tuesday, September 27, 2016 1:13 AM

Answers

  • Hi Sach_B,

    According to your description, does this issue just happen in Excel 2016 for Mac, not in Excel 2016 for Windows? If so, as far as I know that Excel 2016 for Mac supports Record Macro feature, when you record a macro, the macro recorder records all the steps required to complete the actions that you want your macro to perform. 

    For more information, please refer to Create or delete macro in Excel 2016 for Mac

    In addition since this forum is special for Office for Windows, I suggest that you could post your question on Microsoft Community:

    http://answers.microsoft.com/en-us/mac

    Thanks for your understanding.
    • Proposed as answer by David_JunFeng Tuesday, October 11, 2016 1:16 AM
    • Marked as answer by David_JunFeng Tuesday, October 11, 2016 1:16 AM
    Wednesday, September 28, 2016 3:02 AM