Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
I have the following macro that works great on a single worksheet. However, I need to get this to loop through a workbook. What is the most efficient way to do this?
Thanks for your help! Option Explicit Sub Set_Q2_Targets() Dim myRng As Range Dim myCell As Range Set myRng = Nothing On Error Resume Next With Worksheets("Home Equity First Lien") Set myRng = .Range("N14", .Cells(.Rows.Count, "N").End(xlUp)) _ .SpecialCells(xlCellTypeConstants) End With On Error GoTo 0 If myRng Is Nothing Then MsgBox "Macro Error" Exit Sub End If For Each myCell In myRng.Cells With myCell .NumberFormat = "General" .Formula = "=" & .Value End With Next myCell End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Selecting "Save As" adds "Copy of" to file name- MS Excel 2007 | Excel Discussion (Misc queries) | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
Worksheets("Sheetname").Select refuses to kick in from User Defined function | Excel Programming | |||
Cell "A" Adds data to Other Cells | Excel Discussion (Misc queries) | |||
use variable in Workbooks("book1").Worksheets("sheet1").Range("a1" | Excel Programming |