Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How can I cut+paste formulas+formats?


I've got code which transfers:
a. all formulas and formats to another location.
b. specific desired formulas but not cell formats to another location.

The s/s is over 330,000 rows deep which makes manual changes
impossible.

I attach small s/s containing both codes.

What I want to do is copy+paste both formulas and formats from only
those cells which have a number in the cell below to cells 4 columns
along and two rows down. The s/s illustrates this.

Can anyone help please?
Big thanks.
Colwyn.


+-------------------------------------------------------------------+
|Filename: example.xls |
|Download: http://www.thecodecage.com/attachment.php?attachmentid=13|
+-------------------------------------------------------------------+

--
colwyn
------------------------------------------------------------------------
colwyn's Profile: http://www.thecodecage.com/forumz/member.php?userid=34
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=30569

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How can I cut+paste formulas+formats?


Maybe like this:

Code:
--------------------
Sub macro2()
Dim cell As Range

For Each cell In Range("F1", Cells(Rows.Count, "F").End(xlUp))
If cell.HasFormula And IsNumeric(cell.Offset(1).Value) Then
cell.Copy Destination:=cell.Offset(2, 4)
End If
Next cell
End Sub

--------------------


--
shg
------------------------------------------------------------------------
shg's Profile: http://www.thecodecage.com/forumz/member.php?userid=13
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=30569

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How can I cut+paste formulas+formats?


SHG -thanks for your reply. It works a treat. All I had to do was change
"copy" to "cut" (fifth line of code). Very helpful!
Big thanks.
Colwyn.

ps, have looked for 'thread tools' in order to mark "solved" but cannot
locate (??)


--
colwyn
------------------------------------------------------------------------
colwyn's Profile: http://www.thecodecage.com/forumz/member.php?userid=34
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=30569

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How can I cut+paste formulas+formats?


shg - sorry but an error has come to light.
The problem is, ALL cells in column F containing formulas are being
acted on.
I only want those cells containing the bottom-most formula in each
series acted upon.
If you see macro2, this does what I want except that it doesn't
transfer the format over.
Your code seems to do what macro1 does.
Is there a way to get macro2 to cut/paste formats along with the
formulas??
Big thanks.
Colwyn.


+-------------------------------------------------------------------+
|Filename: example 2.xls |
|Download: http://www.thecodecage.com/attachment.php?attachmentid=14|
+-------------------------------------------------------------------+

--
colwyn
------------------------------------------------------------------------
colwyn's Profile: http://www.thecodecage.com/forumz/member.php?userid=34
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=30569

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How can I cut+paste formulas+formats?


Perhaps ...

Code:
--------------------
Sub x()
Dim cell As Range

For Each cell In Range("F1", Cells(Rows.Count, "F").End(xlUp))
With cell
If .HasFormula And Not .Offset(1).HasFormula Then
.Cut Destination:=.Offset(2, 4)
End If
End With
Next cell
End Sub

--------------------


--
shg
------------------------------------------------------------------------
shg's Profile: http://www.thecodecage.com/forumz/member.php?userid=13
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=30569



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default [SOLVED]: How can I cut+paste formulas+formats?


That works perfect.
Fully appreciate your help and patience.
Big thanks.
Colwyn.


--
colwyn
------------------------------------------------------------------------
colwyn's Profile: http://www.thecodecage.com/forumz/member.php?userid=34
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=30569

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
Copy column, paste special formulas & number formats doesn't work Beckey Excel Discussion (Misc queries) 3 July 30th 09 07:51 PM
Paste special from cells without formulas/formats Spartacus Excel Worksheet Functions 2 April 11th 08 04:16 PM
Formats-Paste special pamble Excel Discussion (Misc queries) 1 November 8th 07 06:36 PM
Conditional formats- paste special formats? jcarney Excel Discussion (Misc queries) 1 November 1st 07 06:37 PM
paste conditional formats as formats leo Excel Discussion (Misc queries) 2 July 5th 07 10:06 AM


All times are GMT +1. The time now is 04:23 PM.

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

About Us

"It's about Microsoft Excel"