Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
copy formula from cell above | New Users to Excel | |||
How do i copy a colored cell to another cell using a formula | Excel Discussion (Misc queries) | |||
I copy a formula and the results copy from the original cell | Excel Discussion (Misc queries) | |||
copy formula down a column and have cell references change within formula | New Users to Excel | |||
Copy exact value from one cell to new formula in another cell | Excel Discussion (Misc queries) |