Closed Thread
Results 1 to 4 of 4

Fill the blank cells by above value

Hybrid View

  1. #1
    Registered User
    Join Date
    08-11-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    93

    Fill the blank cells by above value

    Hello,

    Please provide me a macro that would fill the blank cells in column A till row 13 (number of cells filled in column B).

    I have a code if anyone can modify it or can provide me a new code anything can work for me.

    Sandeep

    Sub FillBlanks()

    Dim rRange1 As Range, rRange2 As Range

    Dim iReply As Integer

    If Selection.Cells.Count = 1 Then

    MsgBox "You must select your list and include the blank cells", vbInformation, "OzGrid.com"

    Exit Sub

    ElseIf Selection.Columns.Count > 1 Then

    MsgBox "You must select only one column", vbInformation, "OzGrid.com"

    Exit Sub

    End If



    Set rRange1 = Range(Selection.Cells(1, 1), Cells(65536, Selection.Column).End(xlUp))



    On Error Resume Next

    Set rRange2 = rRange1.SpecialCells(xlCellTypeBlanks)

    On Error GoTo 0



    If rRange2 Is Nothing Then

    MsgBox "No blank cells Found", vbInformation, "OzGrid.com"

    Exit Sub

    End If



    rRange2.FormulaR1C1 = "=R[-1]C"



    iReply = MsgBox("Convert to Values", vbYesNo + vbQuestion, "OzGrid.com")

    If iReply = vbYes Then rRange1 = rRange1.Value

    End Sub
    Attached Files Attached Files

  2. #2
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Fill the blank cells by above value

    Welcome to the Forum, unfortunately:

    This is a duplicate post and as such does not comply with Rule 5 of our forum rules. This thread will now be closed, you may continue in your other thread.

    Thread Closed.
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

  3. #3
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Fill the blank cells by above value

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

  4. #4
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Fill the blank cells by above value

    Your post does not comply with Rule 7 of our Forum RULES. Please do not ignore Moderators' or Administrators' requests - note that this includes requests by senior members as well, if you are unclear about their request or instruction then send a private message to them asking for help. Do not post a reply to a thread where a moderator has requested an action that has not been complied with e.g Title change or Code tags...etc

Closed 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