Share via

Mac office 2016 Excel VBA Copy Paste code error

Anonymous
2016-09-26T01:18:34+00:00

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

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

8 additional answers

Sort by: Most helpful
  1. Anonymous
    2016-09-28T17:28:20+00:00

    Hi Lizzie,

    You've given us the code, but not the worksheet on which the code is designed to run.

    If you can remove confidential and personal information first and then share the workbook, we can try your code on the worksheet you have and see how it goes. You can share your workbook on OneDrive, DropBox or other sharing service and then reply with the link.

    It would also be helpful if you include the version and build number of Excel that you're using. You can find that information in the Excel menu by choosing About Excel.

    Thanks.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2016-09-28T17:26:15+00:00

    You do, but that forum is like 99% for Windows, not Mac.

    THIS is the correct forum for Mac issues.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2016-09-27T01:13:16+00:00

    Thank you very much. Appreciated.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2016-09-27T01:01:52+00:00

    Hi,

    We have another forum where Microsoft experts and software developers can further assist you. To go to this forum, see this link.

    Regards.

    Was this answer helpful?

    0 comments No comments