+ Reply to Thread
Results 1 to 3 of 3

Excel 2007 : worksheet macro hlep

  1. #1
    Registered User
    Join Date
    02-15-2011
    Location
    Cleveland, Oiho
    MS-Off Ver
    Excel 2007
    Posts
    2

    worksheet macro hlep

    I'm a newbie, trying to add some functionality via macros.

    I want to add a new worksheet (copy of all fields and data of first worksheet.., place it (second) after the first worksheet regardless of how many worksheets are present; name the worksheet from a Cell value on the first sheet, and return view to the first worksheet ...

    what I'm missing is the proper placement of the new sheet, and naming it via a cell value.

    here's what I've go so far...


    Sub NewRevision()
    Dim sName As String
    Dim wks As Worksheet
    Worksheets("Current Revision").Copy After:=Sheets(Worksheets.Count)
    Set wks = ActiveSheet
    Do While sName <> wks.Name
    sName = Application.InputBox _
    (Prompt:="Enter as Round_1, Round_2, etc")
    On Error Resume Next
    wks.Name = sName
    On Error GoTo 0
    Loop
    Set wks = Nothing
    Worksheets("Current Revision").Select
    End Sub

  2. #2
    Registered User
    Join Date
    01-21-2011
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: worksheet macro hlep

    Hi,

    U were not getting worksheet at right place, as this code
    Please Login or Register  to view this content.
    will insert worksheet in the end.(what it do is it takes the count of present sheet. let say there are 3 sheets presently, and your coding will insert sheet after three sheet, that means it will come at fourth place.

    Please see the code in blue.

    Note: I have used "Sheet 1" , you can use "current revsion" or whatever your sheet name is

    ---------------------------
    Please Login or Register  to view this content.
    What I have done is to tell excel to display the sheet at 2nd place. I am writting
    Please Login or Register  to view this content.
    that ie it will come after sheet1(no matter whatever the name) so after sheet1 means it will be at 2nd position(as you wanted)

    ------

    for ii issue you are facing like naming the sheet as per the value in some specific cell in sheet1.plz tell which cell value you want to use to name a sheet.

    ----------------------------------------------------------------------------------------
    If It helped you. Click the scales icon (Reputation) in the upper right corner of the contributor's post.

  3. #3
    Registered User
    Join Date
    02-15-2011
    Location
    Cleveland, Oiho
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: worksheet macro hlep

    sorry for the delay...

    The cell I'm looking to name the new worksheet is F6.

    I have also encountered another issue on a simple formula... in a cell configured to return today's date and time, I'm getting 4/9/22 2:46PM. The time is correct, but it feels as though i'm in the future... 2122 to be precise. my formula reads
    =TODAY()+NOW()
    cell number format is 3/14/01 1:30 PM

    arrrgh

+ 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