I need vba code in Excel to convert formula to its value, but only in specific column and only convert till last row with data
Example: Sheet 1 Column B, E:J filled with lookup formula to get data from Sheet 2. Formula is filled from row 1 to 1500. Based on table array in sheet 2. Sheet 1 row 1 to 1000 return lookup result. I need to convert column B, E:J row 1 to 1000 formula to value while row 1001 to 1500 is still have lookup formula
From internet search i can use this code...
Sub FormulaToValue()
Dim N As Long, rng As Range
N = Cells(Rows.Count, "A").End(xlUp).Row
Set rng = Range(Cells(1, 1), Cells(N, Columns.Count))
rng.Value2 = rng.Value2
End Sub
This code will convert formula to value until last row with data only, in this case only row 1 to 1000 will be converted. But this code convert all columns in the sheet. I think i need to change Columns.Count to specific column range but i don't now how to write the right code. I'm not familiar with vba code
Please help. Thank you