Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "Patrick Molloy" wrote in message ... Option Explicit Sub Macro1() For Each ws In Worksheets Set found = ws.Cells.Find("daily") If Not found Is Nothing Then addr = found.Address Do col.Add ws.Name & found.Address(False, False) Set found = ws.Cells.FindNext(found) Loop Until found.Address = addr End If thanks very much, I'll look at the Find FindNext and Address properties to learn those (new to me) meanwhile i also remembered the .UsedRange property and found that what I was looking for was .Formula, not .Value I had changed some range names and wanted to update the formulas referring to them this worked for my very odd one time temp usage Sub ReadFormulas() Dim oRng As Range Dim oWs As Worksheet Dim oCell As Range Dim oWb As Workbook Set oWb = ThisWorkbook For Each oWs In oWb.Worksheets Set oRng = oWs.UsedRange For Each oCell In oRng If Len(oCell.Formula) 0 Then If InStr(1, oCell.Formula, "util", vbTextCompare) 0 Then Debug.Print "Old formula ", oCell.Formula If Len(oCell.Formula) = 8 Then Debug.Print "Old formula ", oCell.Formula '=Utils98 If CLng(Right$(oCell.Formula, 2)) 10 Then oCell.Formula = "=Utils19" & Right$(oCell.Formula, 2) Else oCell.Formula = "=Utils20" & Right$(oCell.Formula, 2) End If Debug.Print "New formula", oCell.Formula '=Utils1999 End If End If End If Next oCell Next oWs End Sub thanks mark |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Search a named range | Excel Worksheet Functions | |||
search values in named formulas | Excel Programming | |||
Macro to select only cells containing values within named range | Excel Programming | |||
inserting a named range into new cells based on a named cell | Excel Discussion (Misc queries) | |||
Search cells in a column and return yes/no if they are present in named range | Excel Programming |