+ Reply to Thread
Results 1 to 9 of 9

To select an Input Sheet to Copy

  1. #1
    Registered User
    Join Date
    08-11-2010
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    58

    To select an Input Sheet to Copy

    Hi All,

    The below code was picked up from this forum and one of this forum members has helped in copying the Value and Format and placing it in the new sheet.

    I am trying to select a sheet to be copied via macro which is not working. I am absolutely new to coding and request the team to excuse me if there is a silly coding mistake.

    Below is the objective:

    The macro should give a dialogue box to select the Input Sheet to be copied rather than explicitly specifying "Sheet Name" in the code
    Best Regards,
    Srikanth

    Please Login or Register  to view this content.
    Would like to implement the above in the below code:

    Please Login or Register  to view this content.
    Last edited by sreeks; 08-28-2010 at 03:35 PM.

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: To select an Input Sheet to Copy

    Hi Srikanth this effectively a double post.

    http://www.excelforum.com/excel-prog...e-a-sheet.html
    Although you have marked this thread [Solved], you have left it open ended with the same question you are asking here!

    Please go back to your last thread and delete the hanging question.

    from
    However, what I am also looking in addition to that is as below:......
    Cheers

  3. #3
    Registered User
    Join Date
    08-11-2010
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    58

    Re: To select an Input Sheet to Copy

    Hi Marco,

    I have updated the previous post and this would be an independent thread.

    Best Regards,
    Sri

  4. #4
    Registered User
    Join Date
    08-11-2010
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    58

    Re: To select an Input Sheet to Copy

    Hi Photon,

    I am trying to use the logic in the code provided by Marco.
    I am unable to execute the code since by default the macro is showing the message "&sPic&" cannot be found.

    My question is if we are using sName as string variable and this is being used as the sheet name, then the same way sPic should be a string variable to recognize the existing Sheet Name.

    Best Regards,
    Sri

    Please Login or Register  to view this content.

  5. #5
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,618

    Re: To select an Input Sheet to Copy

    Umm, is this the right thread?? I'm confused (not again! )
    --------------------------------------------
    sPic is not a string, it is a variable holding a string value:
    Please Login or Register  to view this content.
    Ben Van Johnson

  6. #6
    Registered User
    Join Date
    08-11-2010
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    58

    Re: To select an Input Sheet to Copy

    Hi Photon,

    Sorry for the confusion.
    I had to close the open ended question in the previous thread since that thread was marked as "Solved".

    I changed the code as per your advise and ran it. By default it throws the error message "Sheet cannot be found.

    After this message, the message "Enter the New Sheet Name" is popping up.

    Below is the code for your reference:

    Please Login or Register  to view this content.

    What I also did was I deleted the below section from the code:
    Please Login or Register  to view this content.
    Now the error is

    "Run Time Error '1004'.
    PasteSpecial Method of Range class failed

    Regards,
    Sri

  7. #7
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,618

    Re: To select an Input Sheet to Copy

    Sorry again! The lines I provided were only meant to replace the original lines, leaving all others as is:
    (tested: works)

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    08-11-2010
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    58

    Re: To select an Input Sheet to Copy

    Hi Proton,

    The code works fine, just that I would like to copy only the Format and Values and not formula from the Input Sheet.

    Regards,
    Sri

  9. #9
    Registered User
    Join Date
    08-11-2010
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    58

    Re: To select an Input Sheet to Copy

    Hi Proton,

    I am half through the problem which I am doing manually at the moment.

    I was referring to the below objectives:
    1. Would like to copy only the Format and Values in the new sheet
    2. Would like to copy only certain portion of the Input Sheets and not the entire sheet.

    Attached is for your reference.

    Regards,
    Sri
    Attached Files Attached Files
    Last edited by sreeks; 08-28-2010 at 05:25 PM.

+ 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