PC Review


Reply
Thread Tools Rate Thread

Copy & paste formula down a column

 
 
ChipButtyMan
Guest
Posts: n/a
 
      14th Oct 2008
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 With Quote
 
 
 
 
Mike H
Guest
Posts: n/a
 
      14th Oct 2008
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.
>
>
>
>
>
>

 
Reply With Quote
 
ChipButtyMan
Guest
Posts: n/a
 
      14th Oct 2008
Excellent! Thanks Mike!

 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      14th Oct 2008
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
<(E-Mail Removed)> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy and Paste Formula from ActiveCell to cells in 13 columns priorto the active column sgltaylor Microsoft Excel Programming 1 30th Nov 2009 10:33 AM
Easy eay to copy / paste a formula in column watermt Microsoft Excel Worksheet Functions 2 17th Nov 2009 03:22 PM
copy-->paste-->special "formula" for a whole column =?Utf-8?B?SmFuaXM=?= Microsoft Excel Misc 2 31st Jul 2007 04:40 PM
Save column J only using copy/paste & temporary copy mikeburg Microsoft Excel Programming 2 7th Jun 2006 05:37 PM
Copy/Paste how to avoid the copy of formula cells w/o calc values =?Utf-8?B?RGVubmlz?= Microsoft Excel Misc 10 2nd Mar 2006 10:47 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:12 AM.