+ Reply to Thread
Results 1 to 3 of 3

2010 Macro - insert file name into column, variable rows

  1. #1
    Registered User
    Join Date
    12-10-2013
    Location
    dallas, tx
    MS-Off Ver
    Excel 2007
    Posts
    36

    2010 Macro - insert file name into column, variable rows

    This forum has helped me build a good macro script, but I have one than I'm having trouble putting together.

    I have a spreadsheet, new one each day, that I need to add in the workbook name into each row. The number of rows vary.

    I think I can use this to add in the file name for a defined range but I'm having trouble putting this all together, especially since the number of rows will vary each day.

    Range("L2:L999").Value = ActiveWorkbook.FileName

    Any recommendations?

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: 2010 Macro - insert file name into column, variable rows

    Assuming D is a column which can be used to know where is the last row used, try
    Please Login or Register  to view this content.
    else send an example
    - Battle without fear gives no glory - Just try

  3. #3
    Registered User
    Join Date
    12-10-2013
    Location
    dallas, tx
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: 2010 Macro - insert file name into column, variable rows

    Perfect PCI, thank you!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro For Moving Variable Number of Rows from a CSV file Monthly
    By jaroesner in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-25-2013, 04:59 AM
  2. [SOLVED] Macro code to insert 3 rows on spreadsheet with variable number of rows
    By D18GE in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-17-2013, 07:33 AM
  3. Macro to Automate Transpose column to rows Excel 2010
    By Rayb1969 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-08-2012, 06:51 PM
  4. [SOLVED] Insert a new column using a variable as address in a macro
    By MackPetD in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-31-2006, 02:50 AM
  5. Trying to insert a column using variable in a Macro
    By MackPetD in forum Excel General
    Replies: 1
    Last Post: 07-25-2006, 03:20 AM

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