![]() |
Eliminate one cell
Hi. The code below scans an entire worksheet, and hardcodes and cell with a vlookup formula in it. How can I vary this to EXCLUDE cell C1, meaning leave the vlookup formula in cell C1? Thanks! Dim rCell As Range For Each rCell In ActiveSheet.UsedRange.Cells If UCase(Left(rCell.FormulaR1C1, 8)) = "=VLOOKUP" Then rCell.Value = rCell.Value Next rCell |
Eliminate one cell
Dim rCell As Range
For Each rCell In ActiveSheet.UsedRange.Cells if rcell.address = "$C$1" then 'skip it else If UCase(Left(rCell.FormulaR1C1, 8)) = "=VLOOKUP" Then rCell.Value = rCell.Value end if end if Next rCell Steph wrote: Hi. The code below scans an entire worksheet, and hardcodes and cell with a vlookup formula in it. How can I vary this to EXCLUDE cell C1, meaning leave the vlookup formula in cell C1? Thanks! Dim rCell As Range For Each rCell In ActiveSheet.UsedRange.Cells If UCase(Left(rCell.FormulaR1C1, 8)) = "=VLOOKUP" Then rCell.Value = rCell.Value Next rCell -- Dave Peterson |
Eliminate one cell
Steph
one way: Dim rCell As Range For Each rCell In ActiveSheet.UsedRange.Cells If rCell.Address < "$C$1" Then If UCase(Left(rCell.FormulaR1C1, 8)) = "=VLOOKUP" Then rCell.Value = rCell.Value End If End If Next rCell Regards Trevor "Steph" wrote in message ... Hi. The code below scans an entire worksheet, and hardcodes and cell with a vlookup formula in it. How can I vary this to EXCLUDE cell C1, meaning leave the vlookup formula in cell C1? Thanks! Dim rCell As Range For Each rCell In ActiveSheet.UsedRange.Cells If UCase(Left(rCell.FormulaR1C1, 8)) = "=VLOOKUP" Then rCell.Value = rCell.Value Next rCell |
All times are GMT +1. The time now is 08:21 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com