Results 1 to 9 of 9

Macro to update cells based on a named range

Threaded View

  1. #1
    Registered User
    Join Date
    10-10-2012
    Location
    Reading, PA
    MS-Off Ver
    Excel 2010
    Posts
    6

    Macro to update cells based on a named range

    I currently have a print macro that looks for blanks in column A hides them and prints(shown below). Now i want to add to this macro to have cell B4 update for everything in my named range (named range is List).

    If my named range consisted of 5 items (A,B,C,D,E) I want to macro to put "A" in B4 then print (I have formulas looking at cell B4). Then put "B" in cell B4, and print. And so on.

    Sub Print()
    Application.Calculation = xlManual
    Application.ScreenUpdating = False
    Range("A:A").EntireRow.Hidden = False
    Dim currentRow As Object
    For i = 1 To 2000 'Range("A:A").Rows.Count
        If (Range("A:A").Rows(i).Text = "") Then
            Range("A:A").Rows(i).EntireRow.Hidden = True
        End If
    Next i
    ActiveWindow.SelectedSheets.PrintOut Copies:=1
    Range("A:A").EntireRow.Hidden = False
    Application.ScreenUpdating = True
    Application.Calculation = xlAutomatic
    End Sub
    Thanks,
    Jeff
    Last edited by jeffreybrown; 10-10-2012 at 07:55 PM. Reason: Added code tags for new user. Please use code tags when posting code...Thanks.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1