Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default COPY FORMULA TO THE LAST CELL

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,480
Default COPY FORMULA TO THE LAST CELL

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" wrote in message
...
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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default COPY FORMULA TO THE LAST CELL

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" wrote in message

...



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
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 formula from cell above Sooky-la-la New Users to Excel 3 May 18th 09 12:13 PM
How do i copy a colored cell to another cell using a formula rick Excel Discussion (Misc queries) 2 September 3rd 08 12:16 AM
I copy a formula and the results copy from the original cell brooklynsd Excel Discussion (Misc queries) 1 June 23rd 07 01:35 AM
copy formula down a column and have cell references change within formula brad New Users to Excel 5 May 13th 07 04:38 PM
Copy exact value from one cell to new formula in another cell asg2307 Excel Discussion (Misc queries) 2 February 6th 06 09:33 PM


All times are GMT +1. The time now is 04:08 AM.

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"