PC Review


Reply
Thread Tools Rate Thread

COPY FORMULA TO THE LAST CELL

 
 
K
Guest
Posts: n/a
 
      12th Feb 2008
I got formulas in cells "G5" , "H5" , "I5" , "J5" and "K5" and I got
data in
coloumn "A" aswell. I want Macro to copy the formulas looking at
coloumn "A" data. Like if I got data or values in coloumn "A" from
cell
"A5" to cell "A100" then Macro should copy formulas from
cells "G5" , "H5" , "I5" , "J5" to cells "G100" , "H100" , "I100" ,
"J100"
In other words Macro should always look data to last cell of coloumn
"A" and copy formulas in coloumns "G" , "H" , "I" , "J" and "K" to
same
last cell where the data ends in coloumn "A". Please If anybody can
help.
 
Reply With Quote
 
 
 
 
Roger Govier
Guest
Posts: n/a
 
      12th Feb 2008
Hi

Try

Sub ExtendFormulae()
Dim lr As Long

Sheets("Sheet1").Activate
lr = Cells(Rows.Count, "A").End(xlUp).Row
Range("G5:K5").Copy Range("G5").Offset(0, 0).Range("A1:A" & lr - 4)
Application.CutCopyMode = False

End Sub


--
Regards
Roger Govier

"K" <(E-Mail Removed)> wrote in message
news:4fbf76c8-b81f-47b4-a14d-(E-Mail Removed)...
> I got formulas in cells "G5" , "H5" , "I5" , "J5" and "K5" and I got
> data in
> coloumn "A" aswell. I want Macro to copy the formulas looking at
> coloumn "A" data. Like if I got data or values in coloumn "A" from
> cell
> "A5" to cell "A100" then Macro should copy formulas from
> cells "G5" , "H5" , "I5" , "J5" to cells "G100" , "H100" , "I100" ,
> "J100"
> In other words Macro should always look data to last cell of coloumn
> "A" and copy formulas in coloumns "G" , "H" , "I" , "J" and "K" to
> same
> last cell where the data ends in coloumn "A". Please If anybody can
> help.


 
Reply With Quote
 
K
Guest
Posts: n/a
 
      12th Feb 2008
On 12 Feb, 17:13, "Roger Govier" <roger@technology4unospamdotcodotuk>
wrote:
> Hi
>
> Try
>
> Sub ExtendFormulae()
> Dim lr As Long
>
> * * Sheets("Sheet1").Activate
> * * lr = Cells(Rows.Count, "A").End(xlUp).Row
> * * Range("G5:K5").Copy Range("G5").Offset(0, 0).Range("A1:A" & lr - 4)
> * * Application.CutCopyMode = False
>
> End Sub
>
> --
> Regards
> Roger Govier
>
> "K" <kamranr1...@yahoo.co.uk> wrote in message
>
> news:4fbf76c8-b81f-47b4-a14d-(E-Mail Removed)...
>
>
>
> > I got formulas in cells "G5" , "H5" , "I5" , "J5" and "K5" and I got
> > data in
> > coloumn "A" aswell. I want Macro to copy the formulas looking at
> > coloumn "A" data. Like if I got data or values in coloumn "A" from
> > cell
> > "A5" to cell "A100" then Macro should copy formulas from
> > cells "G5" , "H5" , "I5" , "J5" to cells "G100" , "H100" , "I100" ,
> > "J100"
> > In other words Macro should always look data to last cell of coloumn
> > "A" and copy formulas in coloumns "G" , "H" , "I" , "J" and "K" to
> > same
> > last cell where the data ends in coloumn "A". *Please If anybody can
> > help.- Hide quoted text -

>
> - Show quoted text -


Thanks Roger. your Macro was very helpful
 
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 cell formula returns zero instead of cell value Dorci Microsoft Excel Discussion 1 8th Mar 2011 06:29 PM
How do i copy a colored cell to another cell using a formula rick Microsoft Excel Misc 2 3rd Sep 2008 12:16 AM
I copy a formula and the results copy from the original cell =?Utf-8?B?YnJvb2tseW5zZA==?= Microsoft Excel Misc 1 23rd Jun 2007 01:35 AM
copy formula down a column and have cell references change within formula brad Microsoft Excel New Users 5 13th May 2007 04:38 PM
Copy exact value from one cell to new formula in another cell =?Utf-8?B?YXNnMjMwNw==?= Microsoft Excel Misc 2 6th Feb 2006 09:33 PM


Features
 

Advertising
 

Newsgroups
 


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