+ Reply to Thread
Results 1 to 8 of 8

First Sheet

  1. #1
    Steved
    Guest

    First Sheet

    Hello From Steved

    I've would like to know please, can the below macro
    be change so that no matter what I name Sheet1 it will
    return to sheet1, as an example I'm working in sheet 12.


    Sub Test ()
    Sheets (" Special Kilometres").Select
    Range ("A2").Select
    End Sub

    Thanks in advance.

  2. #2
    Bob Phillips
    Guest

    Re: First Sheet

    Sub Test ()
    Sheet1.Select
    Range ("A2").Select
    End Sub


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Steved" <anonymous@discussions.microsoft.com> wrote in message
    news:2bda01c51ea3$157fd990$a401280a@phx.gbl...
    > Hello From Steved
    >
    > I've would like to know please, can the below macro
    > be change so that no matter what I name Sheet1 it will
    > return to sheet1, as an example I'm working in sheet 12.
    >
    >
    > Sub Test ()
    > Sheets (" Special Kilometres").Select
    > Range ("A2").Select
    > End Sub
    >
    > Thanks in advance.




  3. #3
    Steved
    Guest

    Re: First Sheet

    Thankyou very much.
    >-----Original Message-----
    >Sub Test ()
    >Sheet1.Select
    >Range ("A2").Select
    >End Sub
    >
    >
    >--
    >
    >HTH
    >
    >RP
    >(remove nothere from the email address if mailing direct)
    >
    >
    >"Steved" <anonymous@discussions.microsoft.com> wrote in

    message
    >news:2bda01c51ea3$157fd990$a401280a@phx.gbl...
    >> Hello From Steved
    >>
    >> I've would like to know please, can the below macro
    >> be change so that no matter what I name Sheet1 it will
    >> return to sheet1, as an example I'm working in sheet 12.
    >>
    >>
    >> Sub Test ()
    >> Sheets (" Special Kilometres").Select
    >> Range ("A2").Select
    >> End Sub
    >>
    >> Thanks in advance.

    >
    >
    >.
    >


  4. #4
    Steved
    Guest

    Re: First Sheet

    Hello From Steved

    I've renamed Sheet1 to Otara Service
    Why will the below macro not goto Sheet1

    Sub SaveNClose()
    Range("B5").Select
    Sheet1.Select
    Range("B5").Select
    ActiveWorkbook.Save
    ActiveWorkbook.Close
    End Sub

    Thankyou.
    >-----Original Message-----
    >Sub Test ()
    >Sheet1.Select
    >Range ("A2").Select
    >End Sub
    >
    >
    >--
    >
    >HTH
    >
    >RP
    >(remove nothere from the email address if mailing direct)
    >
    >
    >"Steved" <anonymous@discussions.microsoft.com> wrote in

    message
    >news:2bda01c51ea3$157fd990$a401280a@phx.gbl...
    >> Hello From Steved
    >>
    >> I've would like to know please, can the below macro
    >> be change so that no matter what I name Sheet1 it will
    >> return to sheet1, as an example I'm working in sheet 12.
    >>
    >>
    >> Sub Test ()
    >> Sheets (" Special Kilometres").Select
    >> Range ("A2").Select
    >> End Sub
    >>
    >> Thanks in advance.

    >
    >
    >.
    >


  5. #5
    Bob Phillips
    Guest

    Re: First Sheet

    Should work okay.

    Go into the VBE, and for that workbook, look in the Project Explorer. You
    should see an item Sheet1(Otara Service). If not, what do you see alongside
    Otara Service? That is what you should use instead of Sheet1.Select.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Steved" <anonymous@discussions.microsoft.com> wrote in message
    news:1c6201c51eac$dedab310$a501280a@phx.gbl...
    > Hello From Steved
    >
    > I've renamed Sheet1 to Otara Service
    > Why will the below macro not goto Sheet1
    >
    > Sub SaveNClose()
    > Range("B5").Select
    > Sheet1.Select
    > Range("B5").Select
    > ActiveWorkbook.Save
    > ActiveWorkbook.Close
    > End Sub
    >
    > Thankyou.
    > >-----Original Message-----
    > >Sub Test ()
    > >Sheet1.Select
    > >Range ("A2").Select
    > >End Sub
    > >
    > >
    > >--
    > >
    > >HTH
    > >
    > >RP
    > >(remove nothere from the email address if mailing direct)
    > >
    > >
    > >"Steved" <anonymous@discussions.microsoft.com> wrote in

    > message
    > >news:2bda01c51ea3$157fd990$a401280a@phx.gbl...
    > >> Hello From Steved
    > >>
    > >> I've would like to know please, can the below macro
    > >> be change so that no matter what I name Sheet1 it will
    > >> return to sheet1, as an example I'm working in sheet 12.
    > >>
    > >>
    > >> Sub Test ()
    > >> Sheets (" Special Kilometres").Select
    > >> Range ("A2").Select
    > >> End Sub
    > >>
    > >> Thanks in advance.

    > >
    > >
    > >.
    > >




  6. #6
    Steved
    Guest

    Re: First Sheet

    Hello from Steved

    I see the problem Sheet3(Otara Service).
    I've now inserted a Worksheet and now reads Sheet1(Otara
    Service).

    Thankyou.

    So to recap I've over several files, so as long as it has
    Sheet1(NAME) I can use 1 macro to execute the lot.

    Thankyou


    >-----Original Message-----
    >Should work okay.
    >
    >Go into the VBE, and for that workbook, look in the

    Project Explorer. You
    >should see an item Sheet1(Otara Service). If not, what do

    you see alongside
    >Otara Service? That is what you should use instead of

    Sheet1.Select.
    >
    >--
    >
    >HTH
    >
    >RP
    >(remove nothere from the email address if mailing direct)
    >
    >
    >"Steved" <anonymous@discussions.microsoft.com> wrote in

    message
    >news:1c6201c51eac$dedab310$a501280a@phx.gbl...
    >> Hello From Steved
    >>
    >> I've renamed Sheet1 to Otara Service
    >> Why will the below macro not goto Sheet1
    >>
    >> Sub SaveNClose()
    >> Range("B5").Select
    >> Sheet1.Select
    >> Range("B5").Select
    >> ActiveWorkbook.Save
    >> ActiveWorkbook.Close
    >> End Sub
    >>
    >> Thankyou.
    >> >-----Original Message-----
    >> >Sub Test ()
    >> >Sheet1.Select
    >> >Range ("A2").Select
    >> >End Sub
    >> >
    >> >
    >> >--
    >> >
    >> >HTH
    >> >
    >> >RP
    >> >(remove nothere from the email address if mailing

    direct)
    >> >
    >> >
    >> >"Steved" <anonymous@discussions.microsoft.com> wrote in

    >> message
    >> >news:2bda01c51ea3$157fd990$a401280a@phx.gbl...
    >> >> Hello From Steved
    >> >>
    >> >> I've would like to know please, can the below macro
    >> >> be change so that no matter what I name Sheet1 it

    will
    >> >> return to sheet1, as an example I'm working in sheet

    12.
    >> >>
    >> >>
    >> >> Sub Test ()
    >> >> Sheets (" Special Kilometres").Select
    >> >> Range ("A2").Select
    >> >> End Sub
    >> >>
    >> >> Thanks in advance.
    >> >
    >> >
    >> >.
    >> >

    >
    >
    >.
    >


  7. #7
    Bob Phillips
    Guest

    Re: First Sheet

    Yes, because you are referencing the codename of the sheet, and that does
    not change when someone renames the sheet. All workbook sheets will have a
    codename and an Excel name.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Steved" <anonymous@discussions.microsoft.com> wrote in message
    news:1d3a01c51ecf$55056e50$a501280a@phx.gbl...
    > Hello from Steved
    >
    > I see the problem Sheet3(Otara Service).
    > I've now inserted a Worksheet and now reads Sheet1(Otara
    > Service).
    >
    > Thankyou.
    >
    > So to recap I've over several files, so as long as it has
    > Sheet1(NAME) I can use 1 macro to execute the lot.
    >
    > Thankyou
    >
    >
    > >-----Original Message-----
    > >Should work okay.
    > >
    > >Go into the VBE, and for that workbook, look in the

    > Project Explorer. You
    > >should see an item Sheet1(Otara Service). If not, what do

    > you see alongside
    > >Otara Service? That is what you should use instead of

    > Sheet1.Select.
    > >
    > >--
    > >
    > >HTH
    > >
    > >RP
    > >(remove nothere from the email address if mailing direct)
    > >
    > >
    > >"Steved" <anonymous@discussions.microsoft.com> wrote in

    > message
    > >news:1c6201c51eac$dedab310$a501280a@phx.gbl...
    > >> Hello From Steved
    > >>
    > >> I've renamed Sheet1 to Otara Service
    > >> Why will the below macro not goto Sheet1
    > >>
    > >> Sub SaveNClose()
    > >> Range("B5").Select
    > >> Sheet1.Select
    > >> Range("B5").Select
    > >> ActiveWorkbook.Save
    > >> ActiveWorkbook.Close
    > >> End Sub
    > >>
    > >> Thankyou.
    > >> >-----Original Message-----
    > >> >Sub Test ()
    > >> >Sheet1.Select
    > >> >Range ("A2").Select
    > >> >End Sub
    > >> >
    > >> >
    > >> >--
    > >> >
    > >> >HTH
    > >> >
    > >> >RP
    > >> >(remove nothere from the email address if mailing

    > direct)
    > >> >
    > >> >
    > >> >"Steved" <anonymous@discussions.microsoft.com> wrote in
    > >> message
    > >> >news:2bda01c51ea3$157fd990$a401280a@phx.gbl...
    > >> >> Hello From Steved
    > >> >>
    > >> >> I've would like to know please, can the below macro
    > >> >> be change so that no matter what I name Sheet1 it

    > will
    > >> >> return to sheet1, as an example I'm working in sheet

    > 12.
    > >> >>
    > >> >>
    > >> >> Sub Test ()
    > >> >> Sheets (" Special Kilometres").Select
    > >> >> Range ("A2").Select
    > >> >> End Sub
    > >> >>
    > >> >> Thanks in advance.
    > >> >
    > >> >
    > >> >.
    > >> >

    > >
    > >
    > >.
    > >




  8. #8
    Steved
    Guest

    Re: First Sheet

    Thankyou.

    >-----Original Message-----
    >Yes, because you are referencing the codename of the

    sheet, and that does
    >not change when someone renames the sheet. All workbook

    sheets will have a
    >codename and an Excel name.
    >
    >--
    >
    >HTH
    >
    >RP
    >(remove nothere from the email address if mailing direct)
    >
    >
    >"Steved" <anonymous@discussions.microsoft.com> wrote in

    message
    >news:1d3a01c51ecf$55056e50$a501280a@phx.gbl...
    >> Hello from Steved
    >>
    >> I see the problem Sheet3(Otara Service).
    >> I've now inserted a Worksheet and now reads Sheet1(Otara
    >> Service).
    >>
    >> Thankyou.
    >>
    >> So to recap I've over several files, so as long as it

    has
    >> Sheet1(NAME) I can use 1 macro to execute the lot.
    >>
    >> Thankyou
    >>
    >>
    >> >-----Original Message-----
    >> >Should work okay.
    >> >
    >> >Go into the VBE, and for that workbook, look in the

    >> Project Explorer. You
    >> >should see an item Sheet1(Otara Service). If not, what

    do
    >> you see alongside
    >> >Otara Service? That is what you should use instead of

    >> Sheet1.Select.
    >> >
    >> >--
    >> >
    >> >HTH
    >> >
    >> >RP
    >> >(remove nothere from the email address if mailing

    direct)
    >> >
    >> >
    >> >"Steved" <anonymous@discussions.microsoft.com> wrote in

    >> message
    >> >news:1c6201c51eac$dedab310$a501280a@phx.gbl...
    >> >> Hello From Steved
    >> >>
    >> >> I've renamed Sheet1 to Otara Service
    >> >> Why will the below macro not goto Sheet1
    >> >>
    >> >> Sub SaveNClose()
    >> >> Range("B5").Select
    >> >> Sheet1.Select
    >> >> Range("B5").Select
    >> >> ActiveWorkbook.Save
    >> >> ActiveWorkbook.Close
    >> >> End Sub
    >> >>
    >> >> Thankyou.
    >> >> >-----Original Message-----
    >> >> >Sub Test ()
    >> >> >Sheet1.Select
    >> >> >Range ("A2").Select
    >> >> >End Sub
    >> >> >
    >> >> >
    >> >> >--
    >> >> >
    >> >> >HTH
    >> >> >
    >> >> >RP
    >> >> >(remove nothere from the email address if mailing

    >> direct)
    >> >> >
    >> >> >
    >> >> >"Steved" <anonymous@discussions.microsoft.com>

    wrote in
    >> >> message
    >> >> >news:2bda01c51ea3$157fd990$a401280a@phx.gbl...
    >> >> >> Hello From Steved
    >> >> >>
    >> >> >> I've would like to know please, can the below

    macro
    >> >> >> be change so that no matter what I name Sheet1 it

    >> will
    >> >> >> return to sheet1, as an example I'm working in

    sheet
    >> 12.
    >> >> >>
    >> >> >>
    >> >> >> Sub Test ()
    >> >> >> Sheets (" Special Kilometres").Select
    >> >> >> Range ("A2").Select
    >> >> >> End Sub
    >> >> >>
    >> >> >> Thanks in advance.
    >> >> >
    >> >> >
    >> >> >.
    >> >> >
    >> >
    >> >
    >> >.
    >> >

    >
    >
    >.
    >


+ 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