+ Reply to Thread
Results 1 to 2 of 2

UsedRange

  1. #1
    Registered User
    Join Date
    07-23-2004
    MS-Off Ver
    2007
    Posts
    94

    UsedRange

    Hello,

    I'm having a problem wording some VBA.
    I want to highlight the used range of a sheet, then replace all blank cells with 0.

    I tried using the below code but it says Object Required.

    Sub MyMacro()
    UsedRange.Select
    Selection.Replace What:="", Replacement:="0", LookAt:=xlPart, SearchOrder:=xlByRows
    Selection.FormulaR1C1 = "1"
    End Sub

    Thanks for any advice.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,058

    Re: UsedRange

    Something like this?

    Please Login or Register  to view this content.
    Woo hoo... my first macro... ok... not mine... Someone's else but edited and adopted
    Never use Merged Cells in Excel

+ Reply to Thread

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