+ Reply to Thread
Results 1 to 10 of 10

Changing sheet references in formulas

  1. #1
    Robbyn
    Guest

    Changing sheet references in formulas

    Greetings! Is it possible to change all instances of a page name from 1A! to
    2A! in all formulas on a page with a macro? Or is this just silly?

    TIA,

    Robbyn

  2. #2
    Niek Otten
    Guest

    Re: Changing sheet references in formulas

    You don't have to.
    If you change the sheetname, all formulas (in the same workbook) will be
    adjusted automatically.

    --
    Kind regards,

    Niek Otten

    "Robbyn" <Robbyn@discussions.microsoft.com> wrote in message
    news:55E807BE-9B42-4318-9CB6-83C61287FFCF@microsoft.com...
    > Greetings! Is it possible to change all instances of a page name from 1A!
    > to
    > 2A! in all formulas on a page with a macro? Or is this just silly?
    >
    > TIA,
    >
    > Robbyn




  3. #3
    Niek Otten
    Guest

    Re: Changing sheet references in formulas

    Unless it is used in an INDIRECT() function

    --
    Kind regards,

    Niek Otten

    "Niek Otten" <nicolaus@xs4all.nl> wrote in message
    news:OcYAjpMBGHA.2668@TK2MSFTNGP14.phx.gbl...
    > You don't have to.
    > If you change the sheetname, all formulas (in the same workbook) will be
    > adjusted automatically.
    >
    > --
    > Kind regards,
    >
    > Niek Otten
    >
    > "Robbyn" <Robbyn@discussions.microsoft.com> wrote in message
    > news:55E807BE-9B42-4318-9CB6-83C61287FFCF@microsoft.com...
    >> Greetings! Is it possible to change all instances of a page name from
    >> 1A! to
    >> 2A! in all formulas on a page with a macro? Or is this just silly?
    >>
    >> TIA,
    >>
    >> Robbyn

    >
    >




  4. #4
    Chip Pearson
    Guest

    Re: Changing sheet references in formulas

    Try

    ActiveSheet.UsedRange.Replace What:="'1A'!",
    Replacement:="'2A'!", LookAt:=xlPart, _
    SearchOrder:=xlByRows, MatchCase:=False,
    SearchFormat:=False, _
    ReplaceFormat:=False


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com



    "Robbyn" <Robbyn@discussions.microsoft.com> wrote in message
    news:55E807BE-9B42-4318-9CB6-83C61287FFCF@microsoft.com...
    > Greetings! Is it possible to change all instances of a page
    > name from 1A! to
    > 2A! in all formulas on a page with a macro? Or is this just
    > silly?
    >
    > TIA,
    >
    > Robbyn




  5. #5
    Robbyn
    Guest

    Re: Changing sheet references in formulas

    Actually it is an indirect() function. Grin.

    "Niek Otten" wrote:

    > Unless it is used in an INDIRECT() function
    >
    > --
    > Kind regards,
    >
    > Niek Otten
    >
    > "Niek Otten" <nicolaus@xs4all.nl> wrote in message
    > news:OcYAjpMBGHA.2668@TK2MSFTNGP14.phx.gbl...
    > > You don't have to.
    > > If you change the sheetname, all formulas (in the same workbook) will be
    > > adjusted automatically.
    > >
    > > --
    > > Kind regards,
    > >
    > > Niek Otten
    > >
    > > "Robbyn" <Robbyn@discussions.microsoft.com> wrote in message
    > > news:55E807BE-9B42-4318-9CB6-83C61287FFCF@microsoft.com...
    > >> Greetings! Is it possible to change all instances of a page name from
    > >> 1A! to
    > >> 2A! in all formulas on a page with a macro? Or is this just silly?
    > >>
    > >> TIA,
    > >>
    > >> Robbyn

    > >
    > >

    >
    >
    >


  6. #6
    Niek Otten
    Guest

    Re: Changing sheet references in formulas

    Now how would a formula be able to recognize that some text is a sheet name?

    BTW how is it used? As a literal in the formula or is the name in a cell as
    text?

    If there is something that identifies the text (or part of the formula)
    exclusively as it being meant as an address, you can use Find/Replace or
    Chip's tip

    --
    Kind regards,

    Niek Otten

    "Robbyn" <Robbyn@discussions.microsoft.com> wrote in message
    news:B2412B43-5047-46D1-B2B9-5FEEF3FF6A44@microsoft.com...
    > Actually it is an indirect() function. Grin.
    >
    > "Niek Otten" wrote:
    >
    >> Unless it is used in an INDIRECT() function
    >>
    >> --
    >> Kind regards,
    >>
    >> Niek Otten
    >>
    >> "Niek Otten" <nicolaus@xs4all.nl> wrote in message
    >> news:OcYAjpMBGHA.2668@TK2MSFTNGP14.phx.gbl...
    >> > You don't have to.
    >> > If you change the sheetname, all formulas (in the same workbook) will
    >> > be
    >> > adjusted automatically.
    >> >
    >> > --
    >> > Kind regards,
    >> >
    >> > Niek Otten
    >> >
    >> > "Robbyn" <Robbyn@discussions.microsoft.com> wrote in message
    >> > news:55E807BE-9B42-4318-9CB6-83C61287FFCF@microsoft.com...
    >> >> Greetings! Is it possible to change all instances of a page name from
    >> >> 1A! to
    >> >> 2A! in all formulas on a page with a macro? Or is this just silly?
    >> >>
    >> >> TIA,
    >> >>
    >> >> Robbyn
    >> >
    >> >

    >>
    >>
    >>




  7. #7
    Robbyn
    Guest

    Re: Changing sheet references in formulas

    Niek,

    I copy grades from one sheet which calculates averages, etc. to another
    which is formatted to print onto district-required roll sheets. Rows are
    constantly being added and changed in the source sheet. So, I use the
    indirect function to avoid REF problems in the second sheet.

    =IF(INDIRECT("1A!H"&ROW()+11)=0,"",INDIRECT("1A!H"&ROW()+11))

    I'm not sure if this is the most efficient way, but it works. I need to
    copy and destination fill the above formula onto more sheets and I'm trying
    to avoid manual labor.

    "Niek Otten" wrote:

    > Now how would a formula be able to recognize that some text is a sheet name?
    >
    > BTW how is it used? As a literal in the formula or is the name in a cell as
    > text?
    >
    > If there is something that identifies the text (or part of the formula)
    > exclusively as it being meant as an address, you can use Find/Replace or
    > Chip's tip
    >
    > --
    > Kind regards,
    >
    > Niek Otten
    >
    > "Robbyn" <Robbyn@discussions.microsoft.com> wrote in message
    > news:B2412B43-5047-46D1-B2B9-5FEEF3FF6A44@microsoft.com...
    > > Actually it is an indirect() function. Grin.
    > >
    > > "Niek Otten" wrote:
    > >
    > >> Unless it is used in an INDIRECT() function
    > >>
    > >> --
    > >> Kind regards,
    > >>
    > >> Niek Otten
    > >>
    > >> "Niek Otten" <nicolaus@xs4all.nl> wrote in message
    > >> news:OcYAjpMBGHA.2668@TK2MSFTNGP14.phx.gbl...
    > >> > You don't have to.
    > >> > If you change the sheetname, all formulas (in the same workbook) will
    > >> > be
    > >> > adjusted automatically.
    > >> >
    > >> > --
    > >> > Kind regards,
    > >> >
    > >> > Niek Otten
    > >> >
    > >> > "Robbyn" <Robbyn@discussions.microsoft.com> wrote in message
    > >> > news:55E807BE-9B42-4318-9CB6-83C61287FFCF@microsoft.com...
    > >> >> Greetings! Is it possible to change all instances of a page name from
    > >> >> 1A! to
    > >> >> 2A! in all formulas on a page with a macro? Or is this just silly?
    > >> >>
    > >> >> TIA,
    > >> >>
    > >> >> Robbyn
    > >> >
    > >> >
    > >>
    > >>
    > >>

    >
    >
    >


  8. #8
    Robbyn
    Guest

    Re: Changing sheet references in formulas

    Chip,

    Thanks for the reply. I gave it a shot and I'm getting Named Argument Not
    Found error. My formula looks something like

    =IF(INDIRECT("1A!H"&ROW()+11)=0,"",INDIRECT("1A!H"&ROW()+11))

    with the column increasing in increments if that makes sense.


    "Chip Pearson" wrote:

    > Try
    >
    > ActiveSheet.UsedRange.Replace What:="'1A'!",
    > Replacement:="'2A'!", LookAt:=xlPart, _
    > SearchOrder:=xlByRows, MatchCase:=False,
    > SearchFormat:=False, _
    > ReplaceFormat:=False
    >
    >
    > --
    > Cordially,
    > Chip Pearson
    > Microsoft MVP - Excel
    > Pearson Software Consulting, LLC
    > www.cpearson.com
    >
    >
    >
    > "Robbyn" <Robbyn@discussions.microsoft.com> wrote in message
    > news:55E807BE-9B42-4318-9CB6-83C61287FFCF@microsoft.com...
    > > Greetings! Is it possible to change all instances of a page
    > > name from 1A! to
    > > 2A! in all formulas on a page with a macro? Or is this just
    > > silly?
    > >
    > > TIA,
    > >
    > > Robbyn

    >
    >
    >


  9. #9
    Chip Pearson
    Guest

    Re: Changing sheet references in formulas

    You're probably using an older version of Excel than I am, and
    that version has fewer arguments to Replace that the latest
    version. Try


    ActiveSheet.UsedRange.Replace What:="1A!", _
    Replacement:="2A!", LookAt:=xlPart, _
    SearchOrder:=xlByRows, MatchCase:=False


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com



    "Robbyn" <Robbyn@discussions.microsoft.com> wrote in message
    news:13098E66-D25F-49A9-AD94-2A422C813D99@microsoft.com...
    > Chip,
    >
    > Thanks for the reply. I gave it a shot and I'm getting Named
    > Argument Not
    > Found error. My formula looks something like
    >
    > =IF(INDIRECT("1A!H"&ROW()+11)=0,"",INDIRECT("1A!H"&ROW()+11))
    >
    > with the column increasing in increments if that makes sense.
    >
    >
    > "Chip Pearson" wrote:
    >
    >> Try
    >>
    >> ActiveSheet.UsedRange.Replace What:="'1A'!",
    >> Replacement:="'2A'!", LookAt:=xlPart, _
    >> SearchOrder:=xlByRows, MatchCase:=False,
    >> SearchFormat:=False, _
    >> ReplaceFormat:=False
    >>
    >>
    >> --
    >> Cordially,
    >> Chip Pearson
    >> Microsoft MVP - Excel
    >> Pearson Software Consulting, LLC
    >> www.cpearson.com
    >>
    >>
    >>
    >> "Robbyn" <Robbyn@discussions.microsoft.com> wrote in message
    >> news:55E807BE-9B42-4318-9CB6-83C61287FFCF@microsoft.com...
    >> > Greetings! Is it possible to change all instances of a page
    >> > name from 1A! to
    >> > 2A! in all formulas on a page with a macro? Or is this just
    >> > silly?
    >> >
    >> > TIA,
    >> >
    >> > Robbyn

    >>
    >>
    >>




  10. #10
    Robbyn
    Guest

    Re: Changing sheet references in formulas

    That did the trick! Thank you much!

    "Chip Pearson" wrote:

    > You're probably using an older version of Excel than I am, and
    > that version has fewer arguments to Replace that the latest
    > version. Try
    >
    >
    > ActiveSheet.UsedRange.Replace What:="1A!", _
    > Replacement:="2A!", LookAt:=xlPart, _
    > SearchOrder:=xlByRows, MatchCase:=False
    >
    >
    > --
    > Cordially,
    > Chip Pearson
    > Microsoft MVP - Excel
    > Pearson Software Consulting, LLC
    > www.cpearson.com
    >
    >
    >
    > "Robbyn" <Robbyn@discussions.microsoft.com> wrote in message
    > news:13098E66-D25F-49A9-AD94-2A422C813D99@microsoft.com...
    > > Chip,
    > >
    > > Thanks for the reply. I gave it a shot and I'm getting Named
    > > Argument Not
    > > Found error. My formula looks something like
    > >
    > > =IF(INDIRECT("1A!H"&ROW()+11)=0,"",INDIRECT("1A!H"&ROW()+11))
    > >
    > > with the column increasing in increments if that makes sense.
    > >
    > >
    > > "Chip Pearson" wrote:
    > >
    > >> Try
    > >>
    > >> ActiveSheet.UsedRange.Replace What:="'1A'!",
    > >> Replacement:="'2A'!", LookAt:=xlPart, _
    > >> SearchOrder:=xlByRows, MatchCase:=False,
    > >> SearchFormat:=False, _
    > >> ReplaceFormat:=False
    > >>
    > >>
    > >> --
    > >> Cordially,
    > >> Chip Pearson
    > >> Microsoft MVP - Excel
    > >> Pearson Software Consulting, LLC
    > >> www.cpearson.com
    > >>
    > >>
    > >>
    > >> "Robbyn" <Robbyn@discussions.microsoft.com> wrote in message
    > >> news:55E807BE-9B42-4318-9CB6-83C61287FFCF@microsoft.com...
    > >> > Greetings! Is it possible to change all instances of a page
    > >> > name from 1A! to
    > >> > 2A! in all formulas on a page with a macro? Or is this just
    > >> > silly?
    > >> >
    > >> > TIA,
    > >> >
    > >> > Robbyn
    > >>
    > >>
    > >>

    >
    >
    >


+ 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