Solved

formattig excel from access

Posted on 2016-11-24
3
38 Views
Last Modified: 2016-11-24
Hi
I am using this code from access vba that apply format column from 1 excel to another :

xlsheet2.range("E7:E50000").Copy
Set xlSheet = xlBook.Sheets(3)
        xlApp.Visible = True
        Set rsCurr = CurrentDb.QueryDefs("qtblSubtractedBiWeeklyReport").OpenRecordset
        xlSheet.range("A7").CopyFromRecordset rsCurr
        xlSheet.range("E7:E50000").PasteSpecial Paste:=-4163, Operation:=-4142, SkipBlanks:=True

i got pop-up massege that ask me to confirm OK :
"Data on the clipboard is not the same size and shape as the selected area. Do you want to paste the data anyway?"

How can i solve and cancel this massege?
0
Comment
Question by:drtopserv
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 33

Accepted Solution

by:
Norie earned 500 total points
ID: 41900197
Does it work if you change the paste destination to the top left cell?
      xlSheet.range("E7").PasteSpecial Paste:=-4163, Operation:=-4142, SkipBlanks:=True

Open in new window

0
 
LVL 27

Expert Comment

by:MacroShadow
ID: 41900201
Copy directly from the recordset to the desired destination.
        xlsheet2.range("E7:E50000").Copy
        Set xlSheet = xlBook.Sheets(3)
        xlApp.Visible = True
        Set rsCurr = CurrentDb.QueryDefs("qtblSubtractedBiWeeklyReport").OpenRecordset
        xlSheet.range("E7").CopyFromRecordset rsCurr
        ' xlSheet.range("E7:E50000").PasteSpecial Paste:=-4163, Operation:=-4142, SkipBlanks:=True

Open in new window

0
 

Author Closing Comment

by:drtopserv
ID: 41900233
Great , works!
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question