473,890 Members | 1,191 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Merged Cells - Paste

13 New Member

I have written some code to create a copy workbook of another sheet in a workbook, but the outcome is that the copy has links (='[Original.xls]Sheet1'!A5) for example instead of the values contained within the original workbook.

Also there are merged cells which seem to make my macro fall over - Runtime error '1004': This operation requires merged cells to be identically sized.

I don't understand this as the copy is an exact copy in sizes etc other than the values in the cells!

Is there a way of either making the original process of creating a copy sheet incorporate the column widths and heights with the values pasted or is it a two step process of creating a copy and then pasting in the values seperately.

Please help - this is driving me insane!

Many thanks

May 16 '07 #1
1 1931
807 Recognized Expert Contributor
Can you just use:
Sheets(1).Copy Before:=Sheets( 2)
May 17 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

by: zxo102 | last post by:
Hi there, I need your help for python <--> excel. I want to paste selected cells (range) to different location on the same sheet in Excel through python. I have tried it for a while but could not figure it out. Here is my sample code: import win32com.client xl=win32com.client.Dispatch("Excel.Application") xl.Visible=1 wb = xl.Workbooks.Add( )
by: marfi95 | last post by:
Does anyone know if its possible using the standard controls shipped with vb.net, if its possible to create a listview with merged cells. By merged cells, I'm referring to basically what can be done with Excel, where you can have a row and cells within that row can have multiple rows in them. TIA.
by: Jean-François Michaud | last post by:
I don't really know where to post this. Is there a table layout algorithm forum? We are trying to implement row merging capabilities in an application (VEX). We fetch the information in an XML file (the table structure is already defined in the DTD) in but since everything is row based in the XML, we can not simply expand a cell's height because it augments the height of ALL cells in the corresponding row. How is this traditionally...
by: david | last post by:
I have asked this question before. But it does not work for me. Given radion buttons in the web form design page. What I did is described as follows. A panel control is dragged into the design form, and a table control is dragged into the panel from tooolbox. Add cells for the table through the properties. Now I cut a radio button, and click the table (note I can not select a cell), then right click Paste. The button is not in expected...
by: bruxerjk | last post by:
I need to do the following. I want to copy cells from a number of Excel files, say "1.xls", "2.xls", "3.xls", etc, into successive rows of "All.xls". That is, I'd open "1.xls", copy cells and paste them into row 1 of "All.xls", then open "2.xls", copy cells and paste them into row 2 of "All.xls", and so on. I figure I can do this with some sort of For loop, but can't quite figure out how. What I need to know is a way of pointing to...
by: riwar | last post by:
Hello. I have problem with clear merged cells of excel's sheet. I am use Cells. get_Range(x,x).ClearContents() method, but compiler says that there is no possibility of clear content using this way. Is there any other one?
by: riwar | last post by:
Hello. Anybody knows how to clear merged cells using c#? If i try to do this via ...Cells.get_Range(x,x).ClearContents(); compiler say that there is no possibility to operate with this method on merged cells. Best regards.
by: aamax | last post by:
I have to read data from an excel spreadsheet. the first column has a variable number of rows that are associated with one value (which is in only one of the rows, and it's variable about which one). In excel the rows of column 1 are outlined by a nice border and it's easy to see that this particular value corresponds to the 1..n rows in the following columns. It's basically a 1 to many relationship across the spreadsheet. how can I read...
by: ielamrani | last post by:
Hi, I am getting this error when I try to export to an excel sheet. When I click on a button to export the first time it's fine, I rename the exported excel sheet and I try to export it again and I get the error: Runtime Error 1004: Method ‘Cells’ of Object ‘_Global’ failed It highlight this line: Range("A1:L1").Select sorry the code behind the button is long: . Dim stDocName As String stDocName = "QFinal4"
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.