Results 1 to 6 of 6

How to autofill any formula till last empty cell

Threaded View

  1. #1
    Forum Contributor
    Join Date
    06-08-2012
    Location
    BD
    MS-Off Ver
    Microsoft Office 2016
    Posts
    633

    How to autofill any formula till last empty cell

    Below code are some time working , & some time showing Autofill Method of Range Class Failed
    Can anyone tell me how to fix it? or How to autofill any formula till last empty cell.
    Private Sub rxtcp()
    Sheets("rxtcp").Columns("A:A").Copy Sheets("op").Range("C1")
    Sheets("op").Range("D1").Formula = "=IF(ISNUMBER(SEARCH(""RXOTG-"",RC[-1])),RC[-1],"""")"
    Sheets("op").Range("D1").Autofill Destination:=Range("D1:D60000"), Type:=xlFillDefaul
    End Sub
    I also tried another way but not working
    Range("D1").Select
    Selection.AutoFill Destination:=Range("D1:60000"), Type:=xlFillDefault
    i have tried also like below but some time working some time not working , showing Autofill Method of Range Class Failed
    Sub rxtcp()
    Sheets("rxtcp").Columns("A:A").Copy Sheets("op").Range("C1")
    Dim lRow As Long
    'Find the last filled row in column C
    lRow = Cells(Rows.Count, 3).End(xlUp).Row
    Sheets("op").Range("D1").Formula = "=IF(ISNUMBER(SEARCH(""RXOTG-"",RC[-1])),RC[-1],"""")"
    Range("D1").Select
    Selection.Autofill Destination:=Range("D1:D" & lRow), Type:=xlFillDefault
    End Sub
    Last edited by nur2544; 02-14-2013 at 01:27 AM.

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