Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default replace copy and paste

I have below macro recorded and would like to replace copy and paste
with = Formula if possible.

Range("D8:H8").Select
Selection.AutoFilter
Selection.AutoFilter

Range("B9:D11").Select
Application.CutCopyMode = False
Selection.Copy
Range("B12:D12").Select
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Paste


Selection.AutoFilter Field:=5, Criteria1:="<Prd", Operator:=xlAnd
Range("I10:BZ11").Select
Range("I10:CA11").Select
Selection.Copy

Range("I13:CA13").Select
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Paste

Selection.AutoFilter Field:=5
Application.CutCopyMode = False

Rows("9:11").Select
Selection.EntireRow.Hidden = True


Thanks with any help
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default replace copy and paste

Hi Sliman

Im not sure what you mean, but you could use vba to enter a formula in a cell.

If it is a linking formula then in the vbe you could use something like this.

Range("A5").formula = "='Sheet1!B5'

HTH

Terry

"Sliman" wrote:

I have below macro recorded and would like to replace copy and paste
with = Formula if possible.

Range("D8:H8").Select
Selection.AutoFilter
Selection.AutoFilter

Range("B9:D11").Select
Application.CutCopyMode = False
Selection.Copy
Range("B12:D12").Select
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Paste


Selection.AutoFilter Field:=5, Criteria1:="<Prd", Operator:=xlAnd
Range("I10:BZ11").Select
Range("I10:CA11").Select
Selection.Copy

Range("I13:CA13").Select
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Paste

Selection.AutoFilter Field:=5
Application.CutCopyMode = False

Rows("9:11").Select
Selection.EntireRow.Hidden = True


Thanks with any help

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default replace copy and paste

Sorry but there is a syntax error in my last post:

It should be

Range("A5").formula="=Sheet1!B5"



"Sliman" wrote:

I have below macro recorded and would like to replace copy and paste
with = Formula if possible.

Range("D8:H8").Select
Selection.AutoFilter
Selection.AutoFilter

Range("B9:D11").Select
Application.CutCopyMode = False
Selection.Copy
Range("B12:D12").Select
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Paste


Selection.AutoFilter Field:=5, Criteria1:="<Prd", Operator:=xlAnd
Range("I10:BZ11").Select
Range("I10:CA11").Select
Selection.Copy

Range("I13:CA13").Select
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Paste

Selection.AutoFilter Field:=5
Application.CutCopyMode = False

Rows("9:11").Select
Selection.EntireRow.Hidden = True


Thanks with any help

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
use copy paste function in the find & replace box Shkendi Excel Discussion (Misc queries) 2 January 7th 10 09:53 PM
find and replace help with copy paste Alex43 Excel Discussion (Misc queries) 1 March 17th 08 11:13 PM
Replace normal paste with Paste As Text [email protected] Excel Programming 3 May 3rd 06 02:19 PM
Excel cut/Paste Problem: Year changes after data is copy and paste Asif Excel Discussion (Misc queries) 2 December 9th 05 05:16 PM
Copy and Paste macro needs to paste to a changing cell reference loulou Excel Programming 0 February 24th 05 10:29 AM


All times are GMT +1. The time now is 05:06 PM.

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"