Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default Excel2000: Copy all exept data

Hi

Below is a code snippet from my procedure. When NewNumAllNumAll, then it
copies last 4 rows of used range and pastes for 4*n rows down. The copied
range contains formatted cells (border, color, font, cell merging) + for
some cells the conditional formatting is used, or data validation, and in
some cells are formulas. All this must be copied. But sometimes there can be
also data (user entries) in some cells, which is the cause of my problem.
.....
Select Case NewNumAll
Case Is < NumAll
Sheets("JooksevKuu").Range((9 + 4 * NewNumAll) & ":" &
LastRow).Delete
Case Is NumAll
Sheets("JooksevKuu").Range((LastRow - 3) & ":" & LastRow).Copy
(Sheets("JooksevKuu").Range((LastRow + 1) & ":" & 8 + 4 * NewNumAll))
End Select
.....

There is no problem until last 4 rows in table aren't filled by user. But
when they are, all those data are duplicated in added rows. Of-course it's
possible to clear all entries from added rows after copying (2 ranges to
clear), but maybe there is a way to copy formulas and formats by code,
leaving out all user entries.

Thanks in advance

--
Arvi Laanemets
(When sending e-mail, use address arvil<Attarkon.ee)


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 118
Default Excel2000: Copy all exept data

Hi, Arvi. I use the following code to PasteSpecial column widths, formats,
and values. You can also put in code for other things - check VBA Help for
the Paste Special Method.

HTH
Ed

Sheets("Sheet1").Select
Range("A1").Select
Selection.PasteSpecial Paste:=8 ' this is column widths
Range("A1").Select
Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False
Range("A1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False

"Arvi Laanemets" wrote in message
...
Hi

Below is a code snippet from my procedure. When NewNumAllNumAll, then it
copies last 4 rows of used range and pastes for 4*n rows down. The copied
range contains formatted cells (border, color, font, cell merging) + for
some cells the conditional formatting is used, or data validation, and in
some cells are formulas. All this must be copied. But sometimes there can

be
also data (user entries) in some cells, which is the cause of my problem.
....
Select Case NewNumAll
Case Is < NumAll
Sheets("JooksevKuu").Range((9 + 4 * NewNumAll) & ":" &
LastRow).Delete
Case Is NumAll
Sheets("JooksevKuu").Range((LastRow - 3) & ":" & LastRow).Copy
(Sheets("JooksevKuu").Range((LastRow + 1) & ":" & 8 + 4 * NewNumAll))
End Select
....

There is no problem until last 4 rows in table aren't filled by user. But
when they are, all those data are duplicated in added rows. Of-course it's
possible to clear all entries from added rows after copying (2 ranges to
clear), but maybe there is a way to copy formulas and formats by code,
leaving out all user entries.

Thanks in advance

--
Arvi Laanemets
(When sending e-mail, use address arvil<Attarkon.ee)




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Data Sort in Excel2000 rbul1 Excel Worksheet Functions 2 June 12th 06 04:35 PM
Merge Excel2000 data to Word2000 John Excel Discussion (Misc queries) 0 November 23rd 05 01:45 PM
In EXCEL2000, How can I copy a file and make it usable in MS WORK TampaDog Excel Discussion (Misc queries) 1 September 15th 05 02:02 PM
displaying filtered data on another sheet (Excel2000) Chris Bruno[_3_] Excel Programming 2 December 12th 03 10:29 PM
My workbook doesn't works on no other PC exept mine.... Keith Willshaw Excel Programming 1 August 1st 03 04:46 PM


All times are GMT +1. The time now is 01:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"