+ Reply to Thread
Results 1 to 3 of 3

Multiple Autofill in same column

Hybrid View

  1. #1
    Registered User
    Join Date
    07-29-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    9

    Multiple Autofill in same column

    Dear All,

    As a subject it sounds easy, but I have been looking on net, couldn't find multiple autofill.

    I have a database in which I need to insert Autofill for multiple coding in the same column, for first coding its easy as below:

    Sub Journal()
    Dim LR1 As Long
    
    LR1 = Sheets("Journal").Range("K" & Rows.Count).End(xlUp).Row
    Range("B3").Formula = "30020400"
    Range("B3").AutoFill Range("B3:B" & LR1)
    
    End Sub
    Suppose this coding is till 50th Row and for next blank cell in the row I am using

    Range("B" & Rows.Count).End(xlUp).Offset(1).Formula = "60600050"
    as this autofill must start from the 51st row till the last row as LR1.

    Please help.

  2. #2
    Registered User
    Join Date
    07-29-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Multiple Autofill in same column

    That's strange!!! No one knows....

  3. #3
    Registered User
    Join Date
    07-29-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    9

    Solved:Re: Multiple Autofill in same column

    I got it right, please see below for future reference:

    Sub FillEmpty()
    Dim c As Range
    Dim LR As Long
    
        Sheets("Journal").Activate
        LR = Sheets("Journal").Range("C" & Rows.Count).End(xlUp).Row
        
        For Each c In Range("B4:B" & LR)
        If IsEmpty(c) Then
        c.Offset(-1).Copy c
        End If
        
    Next c
    End Sub
    You just need to call above sub from the main sub.

+ 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