simonmoran
New Member
- Joined
- Nov 30, 2011
- Messages
- 28
So I have a varying amount of data in column BR, the amount of rows will change depending on how much data is being pasted in by the user. I have formulas in columns BS4 through to EB4 that search the data in BR for specific words or phrases
I am trying to write some code that will copy the formula in BS4:EB4 all the way down to the last row in column BR. I then want to paste the data in the same range as values so they are not live.
Using the macro recorder i get the following
It works perfectly apart from it only runs to the set range! How do I change this so that it runs till the last row in column BR?
Thanks
I am trying to write some code that will copy the formula in BS4:EB4 all the way down to the last row in column BR. I then want to paste the data in the same range as values so they are not live.
Using the macro recorder i get the following
PHP:
Sub run()
'
' run Macro
'
'
Range("BS4").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.AutoFill Destination:=Range("BS4:EB29")
Range("BS4:EB29").Select
Range("BS5").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("BS5").Select
Application.CutCopyMode = False
End Sub
It works perfectly apart from it only runs to the set range! How do I change this so that it runs till the last row in column BR?
Thanks