ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   VBA Loop to Find then Copy & Paste (https://www.excelbanter.com/excel-discussion-misc-queries/227743-vba-loop-find-then-copy-paste.html)

B J Hankinson

VBA Loop to Find then Copy & Paste
 
I have been trying to figure out how to loop when using a copy formulas and
then find specific words and paste ( I am also using an offset to paste below
the text I find)

Example:
Colmn Q Colmn R Colmn S
row2 =K2/I2 =(SUM(K2:K3)/(SUM(I2:I3))) =(SUM(K2:K4)/(SUM(I2:I4)))

row5 Write formulas
row10 Write formulas
row11 Write formulas
row20 Write formulas


What I am trying to get to loop is as follows:
Find copy and paste formulas Macro
' Macro recorded 4/2/2009 by BJ
'

'
Range("Q2:T2").Select
Selection.Copy
Cells.Find(What:="write formulas", After:=ActiveCell, LookIn:=xlFormulas _
, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(1, 0).Select
ActiveSheet.Paste

Thank you - am pulling my hair out
--
BJH


All times are GMT +1. The time now is 08:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com