Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Copy & paste formula down a column

Hi,
I have a simple formula like;

=PattMatch(A2,MainMap!$A$12:$F$15,MainMap!$H$11:$I $17,MainMap!$A$19:$B
$24)

I have a command button to enter it into Range("C2")

How do I copy & paste it into all rows below?

Thank you for your help.





  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Copy & paste formula down a column

Hi,

I suspect you don't really mean all rows so change the autifill destination
to the last row you want.

Range("C2").Formula =
"=PattMatch(A2,MainMap!$A$12:$F$15,MainMap!$H$11:$ I$17,MainMap!$A$19:$B$24)"
Range("C2").AutoFill Destination:=Range("C2:C31")

Mike

"ChipButtyMan" wrote:

Hi,
I have a simple formula like;

=PattMatch(A2,MainMap!$A$12:$F$15,MainMap!$H$11:$I $17,MainMap!$A$19:$B
$24)

I have a command button to enter it into Range("C2")

How do I copy & paste it into all rows below?

Thank you for your help.






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Copy & paste formula down a column

Excellent! Thanks Mike!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Copy & paste formula down a column

Sub Auto_Fill()
Dim Lrow As Long
With ActiveSheet
Lrow = .Range("B" & Rows.Count).End(xlUp).Row
.Range("C2:C" & Lrow).FillDown
End With
End Sub

You could use one macro to add the formula to C2 then copy down.

Sub Auto_Fill()
Dim Lrow As Long
With ActiveSheet
.Range("C2").Formula = "=PattMatch(A2,MainMap!$A$12:$F$15," & _
"MainMap!$H$11:$I$17,MainMap!$A$19:$B$24)"
Lrow = .Range("B" & Rows.Count).End(xlUp).Row
.Range("C2:C" & Lrow).FillDown
End With
End Sub



Gord Dibben MS Excel MVP

On Tue, 14 Oct 2008 12:27:47 -0700 (PDT), ChipButtyMan
wrote:

Hi,
I have a simple formula like;

=PattMatch(A2,MainMap!$A$12:$F$15,MainMap!$H$11:$ I$17,MainMap!$A$19:$B
$24)

I have a command button to enter it into Range("C2")

How do I copy & paste it into all rows below?

Thank you for your 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
Easy eay to copy / paste a formula in column watermt Excel Worksheet Functions 2 November 17th 09 03:22 PM
copy--paste--special "formula" for a whole column Janis Excel Discussion (Misc queries) 2 July 31st 07 04:40 PM
Save column J only using copy/paste & temporary copy mikeburg[_85_] Excel Programming 2 June 7th 06 05:37 PM
Copy/Paste how to avoid the copy of formula cells w/o calc values Dennis Excel Discussion (Misc queries) 10 March 2nd 06 10:47 PM
Copy Column and Paste steveh[_3_] Excel Programming 2 February 2nd 04 01:36 PM


All times are GMT +1. The time now is 05:25 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"