Results 1 to 6 of 6

Enter Row Number as a value in cells

Threaded View

  1. #1
    Registered User
    Join Date
    04-02-2012
    Location
    Earth
    MS-Off Ver
    Excel 2013
    Posts
    33

    Enter Row Number as a value in cells

    Hi I'm using tables in excel and importing data from different documents. I have got the browse, open, and import (copy paste) nailed down.

    when I import the data into the table it populates all but the first column as this is a unique sequential ID. I has chosen to use the row number.

    So just before import in the vba I sort the table via this ID column and add the new data to the end.

    I then want to add the unique sequential ID number to the new data.

    so far I have.... nothing that works

        Dim lastRow As Long
    
        ' get the last row from column A that has a value
        Dim FirstBlankCell As Range
        Set FirstBlankCell = Workbooks("Temp").Worksheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
    
        lastRow = Worksheets("Sheet1").Range("A" & Worksheets("Sheet1").Rows.Count).End(xlUp).Row
    
        ' use the last row to determine how far down to extend the formula
        'Worksheets("Sheet1").Range("A" & FirstBlankCell).Formula = "=row()"
        'Worksheets("Sheet1").Range("D" & lastRow + 1).Value = Workbooks(Filename).Name
            
    'lrowp = Worksheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row
    'Worksheets("Sheet1").Range("A2:A" & lrowp).Copy
    'Worksheets("Sheet1").Range("A2:A" & lrowp) _
    '        .PasteSpecial Paste:=xlPasteValues
    
    MsgBox FirstBlankCell
    any ideas? When I have this working I also want to include the file name in the last column as when opening the file the first check is has it already been imported

    thanks

    additional information - I have the copy paste as values only as when sorting tables with a formula reference row it obviously changes to what ever row it sits in messing up the data
    Last edited by vew32; 09-25-2013 at 10:13 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How do I create a button to enter a number in a cell and then tab/enter to next cell
    By MatiasGarcia in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-21-2013, 05:29 PM
  2. auto enter number macro then search for rest of number
    By cfinch100 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-22-2013, 04:24 PM
  3. Formula to enter highest number from a range of cells
    By batjl9 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-26-2011, 04:32 PM
  4. Replies: 1
    Last Post: 04-26-2006, 06:10 AM
  5. [SOLVED] How do I quickly enter the same number into different cells?
    By Cheers100 in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 02-18-2006, 10:30 AM

Tags for this Thread

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