Results 1 to 3 of 3

Unable to link and autofill upto last cell from another workbook

Threaded View

  1. #1
    Registered User
    Join Date
    09-27-2016
    Location
    Pune, India
    MS-Off Ver
    2010
    Posts
    3

    Unable to link and autofill upto last cell from another workbook

    
    Sub CopyDataCB()
    '
    ' CopyData Macro
    '
    
    '
        'determine Last Row
        Dim LastRow As Variant
        Dim SourcePath As String
        SourcePath = "C:\Users\smalghan\Desktop\q11070\01_Working\Quantities_StormCAD.xlsx"
        Workbooks.Open (SourcePath)
        Worksheets("Catch Basin").Activate
        LastRow = ActiveSheet.Cells(ActiveSheet.Rows.Count, "A").End(xlUp).Address
        MsgBox "LastRow: " & LastRow
        
           
        'Determine last cell
        Dim LastCell As String
        LastCell = Range("A1").SpecialCells(xlCellTypeLastCell).Address
        MsgBox "LastCell:" & LastCell
        
        ActiveWorkbook.Close
            
        Worksheets("Catch Basin").Activate
        Range("A1").Select
        ActiveCell.FormulaR1C1 = "='C:\Users\smalghan\Desktop\q11070\01_Working\[Quantities_StormCAD.xlsx]Catch basin'!RC"
        Selection.AutoFill Destination:=Range("A1:LastRow"), Type:=xlFillDefault
       
    End Sub
    Last edited by shmalghan; 09-28-2016 at 09:34 AM. Reason: deleted unnecessary code

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Unable to delete connection/link. No link exists!
    By taylorsm in forum Excel General
    Replies: 1
    Last Post: 03-25-2016, 09:14 AM
  2. Replies: 3
    Last Post: 09-25-2014, 12:28 PM
  3. Unable to link pivot table item in field list to value in a cell
    By VBAprogrammer3502 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-20-2013, 11:13 AM
  4. Unable to find / remove link to external workbook
    By jpruffle in forum Excel General
    Replies: 3
    Last Post: 08-09-2011, 11:41 AM
  5. [SOLVED] cell with highest value g5 would be upto 80=1,81:160=1.5,
    By [email protected] uk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-13-2006, 02:35 PM
  6. [SOLVED] Link A Cell In O ne Workbook To A Formula In Another Workbook
    By Minitman in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-04-2005, 02:15 AM
  7. Replies: 1
    Last Post: 01-07-2005, 10:06 PM

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