ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   MACRO: Convert Row Formula to Value (https://www.excelbanter.com/excel-discussion-misc-queries/156390-macro-convert-row-formula-value.html)

SteveT

MACRO: Convert Row Formula to Value
 
Hello,

I have duplicate formulas through 5000 rows, columns A - F .
I would like to convert the row formulas to values if a result in column F
is present.

is there a simple macro which will
a) Find rows with formula
b) evaluate if cell within row ( column f ) contains result
c) convert row results to values

- over view - trying to reduce the EXTREME size of dependent sheet.

Many thanks !

Steven / Dallas

Gary''s Student

MACRO: Convert Row Formula to Value
 
Hi Steven:

Sub sonic()
n = Cells(Rows.Count, "F").End(xlUp).Row
For i = 1 To n
Set r1 = Range("A" & i)
Set r2 = Range("F" & i)
Set r3 = Range(r1, r2)
If IsEmpty(r2.Value) Then
Else
r3.Copy
r1.PasteSpecial Paste:=xlPasteValues
End If
Next
End Sub

--
Gary''s Student - gsnu200740


"SteveT" wrote:

Hello,

I have duplicate formulas through 5000 rows, columns A - F .
I would like to convert the row formulas to values if a result in column F
is present.

is there a simple macro which will
a) Find rows with formula
b) evaluate if cell within row ( column f ) contains result
c) convert row results to values

- over view - trying to reduce the EXTREME size of dependent sheet.

Many thanks !

Steven / Dallas



All times are GMT +1. The time now is 10:55 PM.

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