+ Reply to Thread
Results 1 to 7 of 7

copy sheet name from one workbook to a cell in another workbook

  1. #1
    Forum Contributor
    Join Date
    08-10-2006
    Posts
    723

    copy sheet name from one workbook to a cell in another workbook

    hi,

    i have a variable CSV file that is downloaded into one of my folders

    what i would like to do is copy that sheetname/or file name ( they are the same )
    to a cell in another workbook that will be open at the same time as i am coping data from the CSV file to the open Excel file
    via a macro . The cell i would like it in is in "J1" "sheet2"

    thanks
    steve
    Last edited by stevekirk; 10-05-2012 at 06:02 AM.

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: copy sheet name from one workbook to a cell in another workbook

    attach your code with comments
    If solved remember to mark Thread as solved

  3. #3
    Forum Contributor
    Join Date
    08-10-2006
    Posts
    723

    Re: copy sheet name from one workbook to a cell in another workbook

    this code lets me select a file CSV file and copy the data to another excel file called " results table"
    what i would like it to do is put the CSV file name into the a cell "j1" in the "results table"
    and then save the excel file as per the name in "J1"


    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: copy sheet name from one workbook to a cell in another workbook

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    08-10-2006
    Posts
    723

    Re: copy sheet name from one workbook to a cell in another workbook

    hi,

    if i run the code on it own it works

    if i put this into my code i get an error about "newpath", "filenam" varibles not defined ,
    could you help me with please

    thanks

    steve
    Last edited by stevekirk; 10-05-2012 at 12:23 AM.

  6. #6
    Forum Contributor
    Join Date
    08-10-2006
    Posts
    723

    Re: copy sheet name from one workbook to a cell in another workbook

    hi ,

    i have tried this but the workbook does not close with the SET WBCSV
    could you please help me to solve this probelm

    thanks
    steve


    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: copy sheet name from one workbook to a cell in another workbook

    maybe you have option explicit in your code, then you have to declare all variables
    dim wbcsv as workbook, newpath as string, filenam as string

+ 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