+ Reply to Thread
Results 1 to 10 of 10

Number format based on number format of another cell in another workbook

  1. #1
    Rob
    Guest

    Number format based on number format of another cell in another workbook

    Excel 2000

    I have two files, one master and one created by opening a text file. The
    master file has a list of unique product codes and descriptions in two
    columns, the text that is opened has the product codes and I add during the
    opening process a look up to the product code to return the product
    description, this all works fine. The text file after opening is 7 columns,
    product code, product description and 5 columns of numbers.

    What I need to do is format the cells (numbers) in the last 5 columns of the
    newly opened text file. My thoughts are to add a third column to the master
    file whereby I'll have 3 columns: product code, product description and
    number format, in the number format column I would format the cell with the
    required number format. My issue is, how using VBA do I format the cells in
    the newly opened text file where the product code matches that of the
    corresponding product code in the master file. The text file can have many
    of the same product codes and in some instances, not all of the product
    codes.

    I had also thought of Conditioning Format but alas, this doesn't cover
    number formatting.

    Any pointers, snippets of code most welcome.

    Thanks, Rob



  2. #2
    Bob Phillips
    Guest

    Re: Number format based on number format of another cell in another workbook

    The Conditional Formatter add-in,
    http://www.xldynamic.com/source/xld.....Download.html, handles cell
    formats as well as the usual CF attributes.

    --

    HTH

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


    "Rob" <anonymous@discussions.microsoft.com> wrote in message
    news:eRucY0j9EHA.2676@TK2MSFTNGP12.phx.gbl...
    > Excel 2000
    >
    > I have two files, one master and one created by opening a text file. The
    > master file has a list of unique product codes and descriptions in two
    > columns, the text that is opened has the product codes and I add during

    the
    > opening process a look up to the product code to return the product
    > description, this all works fine. The text file after opening is 7

    columns,
    > product code, product description and 5 columns of numbers.
    >
    > What I need to do is format the cells (numbers) in the last 5 columns of

    the
    > newly opened text file. My thoughts are to add a third column to the

    master
    > file whereby I'll have 3 columns: product code, product description and
    > number format, in the number format column I would format the cell with

    the
    > required number format. My issue is, how using VBA do I format the cells

    in
    > the newly opened text file where the product code matches that of the
    > corresponding product code in the master file. The text file can have

    many
    > of the same product codes and in some instances, not all of the product
    > codes.
    >
    > I had also thought of Conditioning Format but alas, this doesn't cover
    > number formatting.
    >
    > Any pointers, snippets of code most welcome.
    >
    > Thanks, Rob
    >
    >




  3. #3
    Rob
    Guest

    Re: Number format based on number format of another cell in another workbook

    Bob,

    Great Add-In. However, not allowing the formula Vlookup to look up product
    code and apply number format.

    "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
    news:e6%237LEk9EHA.3988@TK2MSFTNGP11.phx.gbl...
    > The Conditional Formatter add-in,
    > http://www.xldynamic.com/source/xld.....Download.html, handles cell
    > formats as well as the usual CF attributes.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "Rob" <anonymous@discussions.microsoft.com> wrote in message
    > news:eRucY0j9EHA.2676@TK2MSFTNGP12.phx.gbl...
    >> Excel 2000
    >>
    >> I have two files, one master and one created by opening a text file. The
    >> master file has a list of unique product codes and descriptions in two
    >> columns, the text that is opened has the product codes and I add during

    > the
    >> opening process a look up to the product code to return the product
    >> description, this all works fine. The text file after opening is 7

    > columns,
    >> product code, product description and 5 columns of numbers.
    >>
    >> What I need to do is format the cells (numbers) in the last 5 columns of

    > the
    >> newly opened text file. My thoughts are to add a third column to the

    > master
    >> file whereby I'll have 3 columns: product code, product description and
    >> number format, in the number format column I would format the cell with

    > the
    >> required number format. My issue is, how using VBA do I format the cells

    > in
    >> the newly opened text file where the product code matches that of the
    >> corresponding product code in the master file. The text file can have

    > many
    >> of the same product codes and in some instances, not all of the product
    >> codes.
    >>
    >> I had also thought of Conditioning Format but alas, this doesn't cover
    >> number formatting.
    >>
    >> Any pointers, snippets of code most welcome.
    >>
    >> Thanks, Rob
    >>
    >>

    >
    >




  4. #4
    Bob Phillips
    Guest

    Re: Number format based on number format of another cell in another workbook

    Rob,

    Sorry, not exactly sure what you mean? It would be the add-in itself that
    allows the number format. So, if you had a VLOOKUP in the cell, you would
    apply the add-in just like normal CF to test the value, and set the format
    accordingly.

    --

    HTH

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


    "Rob" <anonymous@discussions.microsoft.com> wrote in message
    news:OSgEBSk9EHA.1392@tk2msftngp13.phx.gbl...
    > Bob,
    >
    > Great Add-In. However, not allowing the formula Vlookup to look up

    product
    > code and apply number format.
    >
    > "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
    > news:e6%237LEk9EHA.3988@TK2MSFTNGP11.phx.gbl...
    > > The Conditional Formatter add-in,
    > > http://www.xldynamic.com/source/xld.....Download.html, handles cell
    > > formats as well as the usual CF attributes.
    > >
    > > --
    > >
    > > HTH
    > >
    > > RP
    > > (remove nothere from the email address if mailing direct)
    > >
    > >
    > > "Rob" <anonymous@discussions.microsoft.com> wrote in message
    > > news:eRucY0j9EHA.2676@TK2MSFTNGP12.phx.gbl...
    > >> Excel 2000
    > >>
    > >> I have two files, one master and one created by opening a text file.

    The
    > >> master file has a list of unique product codes and descriptions in two
    > >> columns, the text that is opened has the product codes and I add during

    > > the
    > >> opening process a look up to the product code to return the product
    > >> description, this all works fine. The text file after opening is 7

    > > columns,
    > >> product code, product description and 5 columns of numbers.
    > >>
    > >> What I need to do is format the cells (numbers) in the last 5 columns

    of
    > > the
    > >> newly opened text file. My thoughts are to add a third column to the

    > > master
    > >> file whereby I'll have 3 columns: product code, product description and
    > >> number format, in the number format column I would format the cell with

    > > the
    > >> required number format. My issue is, how using VBA do I format the

    cells
    > > in
    > >> the newly opened text file where the product code matches that of the
    > >> corresponding product code in the master file. The text file can have

    > > many
    > >> of the same product codes and in some instances, not all of the product
    > >> codes.
    > >>
    > >> I had also thought of Conditioning Format but alas, this doesn't cover
    > >> number formatting.
    > >>
    > >> Any pointers, snippets of code most welcome.
    > >>
    > >> Thanks, Rob
    > >>
    > >>

    > >
    > >

    >
    >




  5. #5
    Sharad Naik
    Guest

    Re: Number format based on number format of another cell in another workbook

    Thoug i did not understand fully when exactly you want to format the cell,
    I assume that if the VLOOKUP succeeds you want to format that 5 column, else
    you want to leave it as it is.
    I also assume that presently you are doing VLOOKP in the sheet itself with
    standard VLOOKUP formula
    entered and drag-copied?
    If this is true then where the VLOOUP did not succeed it will show "N#A"

    So you can write code like below

    For each c In Workbooks("Text").Worksheets("xyz").Range("B:B").Cells
    If Not c.Text = "N#A" Then 'note: it should be c.Text not c.Value
    c.Offset(0,5).NumberFormat = "whatever"
    End If
    Next
    Ofcource you can refer to the column until the last used row, I just skipped
    that part.

    You can put it in workbook open event or make it a module macro and run
    whenever
    you feel.

    But in case you are doing it different way and "N#A" does not appear in the
    cell
    ( many times I suppress "N#A" adding IF( ISERR(VLOOKUP .. )
    Then you can make code in VBA to check if VLOOKUP is an error
    and if not then format the number. e.g.:

    Dim c
    On Error Resume Next
    For Each c In Workbooks("Text").Worksheets("xyz").Range("A:A1")
    If Not IsError(Application.WorksheetFunction.VLookup _
    (c.Value, Workbooks("Master").Worksheets("xyz") _
    .Range("A:B"), 2, False)) Then
    c.Offset(0, 6).NumberFormat = "whatever"
    End If
    Next c

    Note: I didn't refer to the ranges properly in above example.

    Sharad


    "Rob" <anonymous@discussions.microsoft.com> wrote in message
    news:eRucY0j9EHA.2676@TK2MSFTNGP12.phx.gbl...
    > Excel 2000
    >
    > I have two files, one master and one created by opening a text file. The
    > master file has a list of unique product codes and descriptions in two
    > columns, the text that is opened has the product codes and I add during
    > the opening process a look up to the product code to return the product
    > description, this all works fine. The text file after opening is 7
    > columns, product code, product description and 5 columns of numbers.
    >
    > What I need to do is format the cells (numbers) in the last 5 columns of
    > the newly opened text file. My thoughts are to add a third column to the
    > master file whereby I'll have 3 columns: product code, product description
    > and number format, in the number format column I would format the cell
    > with the required number format. My issue is, how using VBA do I format
    > the cells in the newly opened text file where the product code matches
    > that of the corresponding product code in the master file. The text file
    > can have many of the same product codes and in some instances, not all of
    > the product codes.
    >
    > I had also thought of Conditioning Format but alas, this doesn't cover
    > number formatting.
    >
    > Any pointers, snippets of code most welcome.
    >
    > Thanks, Rob
    >




  6. #6
    Rob
    Guest

    Re: Number format based on number format of another cell in another workbook

    Bob,

    I've tried again, this time adding a Vlookup column in my opened text file
    that returns 2, the CF add-in is set up likewise to format the cell to 2
    decimal places. However, there are c. 200 rows and using the CF add-in copy
    and past function, the reference is always to the initial formula and as
    such would take forever to setup each cell condition. That is unless
    there's a VBA method of setting up for each cell.

    Regards, Rob

    "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
    news:egIVjrk9EHA.1084@TK2MSFTNGP15.phx.gbl...
    > Rob,
    >
    > Sorry, not exactly sure what you mean? It would be the add-in itself that
    > allows the number format. So, if you had a VLOOKUP in the cell, you would
    > apply the add-in just like normal CF to test the value, and set the format
    > accordingly.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "Rob" <anonymous@discussions.microsoft.com> wrote in message
    > news:OSgEBSk9EHA.1392@tk2msftngp13.phx.gbl...
    >> Bob,
    >>
    >> Great Add-In. However, not allowing the formula Vlookup to look up

    > product
    >> code and apply number format.
    >>
    >> "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
    >> news:e6%237LEk9EHA.3988@TK2MSFTNGP11.phx.gbl...
    >> > The Conditional Formatter add-in,
    >> > http://www.xldynamic.com/source/xld.....Download.html, handles cell
    >> > formats as well as the usual CF attributes.
    >> >
    >> > --
    >> >
    >> > HTH
    >> >
    >> > RP
    >> > (remove nothere from the email address if mailing direct)
    >> >
    >> >
    >> > "Rob" <anonymous@discussions.microsoft.com> wrote in message
    >> > news:eRucY0j9EHA.2676@TK2MSFTNGP12.phx.gbl...
    >> >> Excel 2000
    >> >>
    >> >> I have two files, one master and one created by opening a text file.

    > The
    >> >> master file has a list of unique product codes and descriptions in two
    >> >> columns, the text that is opened has the product codes and I add
    >> >> during
    >> > the
    >> >> opening process a look up to the product code to return the product
    >> >> description, this all works fine. The text file after opening is 7
    >> > columns,
    >> >> product code, product description and 5 columns of numbers.
    >> >>
    >> >> What I need to do is format the cells (numbers) in the last 5 columns

    > of
    >> > the
    >> >> newly opened text file. My thoughts are to add a third column to the
    >> > master
    >> >> file whereby I'll have 3 columns: product code, product description
    >> >> and
    >> >> number format, in the number format column I would format the cell
    >> >> with
    >> > the
    >> >> required number format. My issue is, how using VBA do I format the

    > cells
    >> > in
    >> >> the newly opened text file where the product code matches that of the
    >> >> corresponding product code in the master file. The text file can have
    >> > many
    >> >> of the same product codes and in some instances, not all of the
    >> >> product
    >> >> codes.
    >> >>
    >> >> I had also thought of Conditioning Format but alas, this doesn't cover
    >> >> number formatting.
    >> >>
    >> >> Any pointers, snippets of code most welcome.
    >> >>
    >> >> Thanks, Rob
    >> >>
    >> >>
    >> >
    >> >

    >>
    >>

    >
    >




  7. #7
    Rob
    Guest

    Re: Number format based on number format of another cell in another workbook

    Sharad,

    The last example looks to have some possibilities, I'll set up and test in
    my files. Now you've given the idea, I recall code CASE where I could set
    up the criteria.

    Thanks, Rob

    "Sharad Naik" <sharadnaik@nospam-vsnl.net> wrote in message
    news:%23Xat1uk9EHA.1296@TK2MSFTNGP10.phx.gbl...
    > Thoug i did not understand fully when exactly you want to format the cell,
    > I assume that if the VLOOKUP succeeds you want to format that 5 column,
    > else you want to leave it as it is.
    > I also assume that presently you are doing VLOOKP in the sheet itself with
    > standard VLOOKUP formula
    > entered and drag-copied?
    > If this is true then where the VLOOUP did not succeed it will show "N#A"
    >
    > So you can write code like below
    >
    > For each c In Workbooks("Text").Worksheets("xyz").Range("B:B").Cells
    > If Not c.Text = "N#A" Then 'note: it should be c.Text not c.Value
    > c.Offset(0,5).NumberFormat = "whatever"
    > End If
    > Next
    > Ofcource you can refer to the column until the last used row, I just
    > skipped that part.
    >
    > You can put it in workbook open event or make it a module macro and run
    > whenever
    > you feel.
    >
    > But in case you are doing it different way and "N#A" does not appear in
    > the cell
    > ( many times I suppress "N#A" adding IF( ISERR(VLOOKUP .. )
    > Then you can make code in VBA to check if VLOOKUP is an error
    > and if not then format the number. e.g.:
    >
    > Dim c
    > On Error Resume Next
    > For Each c In Workbooks("Text").Worksheets("xyz").Range("A:A1")
    > If Not IsError(Application.WorksheetFunction.VLookup _
    > (c.Value, Workbooks("Master").Worksheets("xyz") _
    > .Range("A:B"), 2, False)) Then
    > c.Offset(0, 6).NumberFormat = "whatever"
    > End If
    > Next c
    >
    > Note: I didn't refer to the ranges properly in above example.
    >
    > Sharad
    >
    >
    > "Rob" <anonymous@discussions.microsoft.com> wrote in message
    > news:eRucY0j9EHA.2676@TK2MSFTNGP12.phx.gbl...
    >> Excel 2000
    >>
    >> I have two files, one master and one created by opening a text file. The
    >> master file has a list of unique product codes and descriptions in two
    >> columns, the text that is opened has the product codes and I add during
    >> the opening process a look up to the product code to return the product
    >> description, this all works fine. The text file after opening is 7
    >> columns, product code, product description and 5 columns of numbers.
    >>
    >> What I need to do is format the cells (numbers) in the last 5 columns of
    >> the newly opened text file. My thoughts are to add a third column to the
    >> master file whereby I'll have 3 columns: product code, product
    >> description and number format, in the number format column I would format
    >> the cell with the required number format. My issue is, how using VBA do
    >> I format the cells in the newly opened text file where the product code
    >> matches that of the corresponding product code in the master file. The
    >> text file can have many of the same product codes and in some instances,
    >> not all of the product codes.
    >>
    >> I had also thought of Conditioning Format but alas, this doesn't cover
    >> number formatting.
    >>
    >> Any pointers, snippets of code most welcome.
    >>
    >> Thanks, Rob
    >>

    >
    >




  8. #8
    Bob Phillips
    Guest

    Re: Number format based on number format of another cell in another workbook

    Rob,

    There is, the same as with normal CF.

    Select all the cells, launch CFPlus, and then reference just the first cell
    in the selection for the CFPLus formula.

    --

    HTH

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


    "Rob" <anonymous@discussions.microsoft.com> wrote in message
    news:OiJG40k9EHA.2016@TK2MSFTNGP15.phx.gbl...
    > Bob,
    >
    > I've tried again, this time adding a Vlookup column in my opened text file
    > that returns 2, the CF add-in is set up likewise to format the cell to 2
    > decimal places. However, there are c. 200 rows and using the CF add-in

    copy
    > and past function, the reference is always to the initial formula and as
    > such would take forever to setup each cell condition. That is unless
    > there's a VBA method of setting up for each cell.
    >
    > Regards, Rob
    >
    > "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
    > news:egIVjrk9EHA.1084@TK2MSFTNGP15.phx.gbl...
    > > Rob,
    > >
    > > Sorry, not exactly sure what you mean? It would be the add-in itself

    that
    > > allows the number format. So, if you had a VLOOKUP in the cell, you

    would
    > > apply the add-in just like normal CF to test the value, and set the

    format
    > > accordingly.
    > >
    > > --
    > >
    > > HTH
    > >
    > > RP
    > > (remove nothere from the email address if mailing direct)
    > >
    > >
    > > "Rob" <anonymous@discussions.microsoft.com> wrote in message
    > > news:OSgEBSk9EHA.1392@tk2msftngp13.phx.gbl...
    > >> Bob,
    > >>
    > >> Great Add-In. However, not allowing the formula Vlookup to look up

    > > product
    > >> code and apply number format.
    > >>
    > >> "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
    > >> news:e6%237LEk9EHA.3988@TK2MSFTNGP11.phx.gbl...
    > >> > The Conditional Formatter add-in,
    > >> > http://www.xldynamic.com/source/xld.....Download.html, handles

    cell
    > >> > formats as well as the usual CF attributes.
    > >> >
    > >> > --
    > >> >
    > >> > HTH
    > >> >
    > >> > RP
    > >> > (remove nothere from the email address if mailing direct)
    > >> >
    > >> >
    > >> > "Rob" <anonymous@discussions.microsoft.com> wrote in message
    > >> > news:eRucY0j9EHA.2676@TK2MSFTNGP12.phx.gbl...
    > >> >> Excel 2000
    > >> >>
    > >> >> I have two files, one master and one created by opening a text file.

    > > The
    > >> >> master file has a list of unique product codes and descriptions in

    two
    > >> >> columns, the text that is opened has the product codes and I add
    > >> >> during
    > >> > the
    > >> >> opening process a look up to the product code to return the product
    > >> >> description, this all works fine. The text file after opening is 7
    > >> > columns,
    > >> >> product code, product description and 5 columns of numbers.
    > >> >>
    > >> >> What I need to do is format the cells (numbers) in the last 5

    columns
    > > of
    > >> > the
    > >> >> newly opened text file. My thoughts are to add a third column to

    the
    > >> > master
    > >> >> file whereby I'll have 3 columns: product code, product description
    > >> >> and
    > >> >> number format, in the number format column I would format the cell
    > >> >> with
    > >> > the
    > >> >> required number format. My issue is, how using VBA do I format the

    > > cells
    > >> > in
    > >> >> the newly opened text file where the product code matches that of

    the
    > >> >> corresponding product code in the master file. The text file can

    have
    > >> > many
    > >> >> of the same product codes and in some instances, not all of the
    > >> >> product
    > >> >> codes.
    > >> >>
    > >> >> I had also thought of Conditioning Format but alas, this doesn't

    cover
    > >> >> number formatting.
    > >> >>
    > >> >> Any pointers, snippets of code most welcome.
    > >> >>
    > >> >> Thanks, Rob
    > >> >>
    > >> >>
    > >> >
    > >> >
    > >>
    > >>

    > >
    > >

    >
    >




  9. #9
    Rob
    Guest

    Re: Number format based on number format of another cell in another workbook

    Bob,

    Thank for that CF Plus does the job. I've recorded a macro which open the
    CF application but is there any code that would for example after selecting
    the range enter the formula =C3=2 and number format 2 decimal places?

    Regards, Rob
    "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
    news:eP9QjJl9EHA.2192@TK2MSFTNGP14.phx.gbl...
    > Rob,
    >
    > There is, the same as with normal CF.
    >
    > Select all the cells, launch CFPlus, and then reference just the first
    > cell
    > in the selection for the CFPLus formula.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "Rob" <anonymous@discussions.microsoft.com> wrote in message
    > news:OiJG40k9EHA.2016@TK2MSFTNGP15.phx.gbl...
    >> Bob,
    >>
    >> I've tried again, this time adding a Vlookup column in my opened text
    >> file
    >> that returns 2, the CF add-in is set up likewise to format the cell to 2
    >> decimal places. However, there are c. 200 rows and using the CF add-in

    > copy
    >> and past function, the reference is always to the initial formula and as
    >> such would take forever to setup each cell condition. That is unless
    >> there's a VBA method of setting up for each cell.
    >>
    >> Regards, Rob
    >>
    >> "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
    >> news:egIVjrk9EHA.1084@TK2MSFTNGP15.phx.gbl...
    >> > Rob,
    >> >
    >> > Sorry, not exactly sure what you mean? It would be the add-in itself

    > that
    >> > allows the number format. So, if you had a VLOOKUP in the cell, you

    > would
    >> > apply the add-in just like normal CF to test the value, and set the

    > format
    >> > accordingly.
    >> >
    >> > --
    >> >
    >> > HTH
    >> >
    >> > RP
    >> > (remove nothere from the email address if mailing direct)
    >> >
    >> >
    >> > "Rob" <anonymous@discussions.microsoft.com> wrote in message
    >> > news:OSgEBSk9EHA.1392@tk2msftngp13.phx.gbl...
    >> >> Bob,
    >> >>
    >> >> Great Add-In. However, not allowing the formula Vlookup to look up
    >> > product
    >> >> code and apply number format.
    >> >>
    >> >> "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
    >> >> news:e6%237LEk9EHA.3988@TK2MSFTNGP11.phx.gbl...
    >> >> > The Conditional Formatter add-in,
    >> >> > http://www.xldynamic.com/source/xld.....Download.html, handles

    > cell
    >> >> > formats as well as the usual CF attributes.
    >> >> >
    >> >> > --
    >> >> >
    >> >> > HTH
    >> >> >
    >> >> > RP
    >> >> > (remove nothere from the email address if mailing direct)
    >> >> >
    >> >> >
    >> >> > "Rob" <anonymous@discussions.microsoft.com> wrote in message
    >> >> > news:eRucY0j9EHA.2676@TK2MSFTNGP12.phx.gbl...
    >> >> >> Excel 2000
    >> >> >>
    >> >> >> I have two files, one master and one created by opening a text
    >> >> >> file.
    >> > The
    >> >> >> master file has a list of unique product codes and descriptions in

    > two
    >> >> >> columns, the text that is opened has the product codes and I add
    >> >> >> during
    >> >> > the
    >> >> >> opening process a look up to the product code to return the product
    >> >> >> description, this all works fine. The text file after opening is 7
    >> >> > columns,
    >> >> >> product code, product description and 5 columns of numbers.
    >> >> >>
    >> >> >> What I need to do is format the cells (numbers) in the last 5

    > columns
    >> > of
    >> >> > the
    >> >> >> newly opened text file. My thoughts are to add a third column to

    > the
    >> >> > master
    >> >> >> file whereby I'll have 3 columns: product code, product description
    >> >> >> and
    >> >> >> number format, in the number format column I would format the cell
    >> >> >> with
    >> >> > the
    >> >> >> required number format. My issue is, how using VBA do I format the
    >> > cells
    >> >> > in
    >> >> >> the newly opened text file where the product code matches that of

    > the
    >> >> >> corresponding product code in the master file. The text file can

    > have
    >> >> > many
    >> >> >> of the same product codes and in some instances, not all of the
    >> >> >> product
    >> >> >> codes.
    >> >> >>
    >> >> >> I had also thought of Conditioning Format but alas, this doesn't

    > cover
    >> >> >> number formatting.
    >> >> >>
    >> >> >> Any pointers, snippets of code most welcome.
    >> >> >>
    >> >> >> Thanks, Rob
    >> >> >>
    >> >> >>
    >> >> >
    >> >> >
    >> >>
    >> >>
    >> >
    >> >

    >>
    >>

    >
    >




  10. #10
    Bob Phillips
    Guest

    Re: Number format based on number format of another cell in another workbook

    Rob,

    No there isn't I am afraid. Recording doesn't record the actions in a
    dialog, and this is all dialog. But it shouldn't be necessary, as it is a
    once-off action to select all the cells and add the formula and format.

    --

    HTH

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


    "Rob" <anonymous@discussions.microsoft.com> wrote in message
    news:uYaPuXl9EHA.3124@TK2MSFTNGP11.phx.gbl...
    > Bob,
    >
    > Thank for that CF Plus does the job. I've recorded a macro which open the
    > CF application but is there any code that would for example after

    selecting
    > the range enter the formula =C3=2 and number format 2 decimal places?
    >
    > Regards, Rob
    > "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
    > news:eP9QjJl9EHA.2192@TK2MSFTNGP14.phx.gbl...
    > > Rob,
    > >
    > > There is, the same as with normal CF.
    > >
    > > Select all the cells, launch CFPlus, and then reference just the first
    > > cell
    > > in the selection for the CFPLus formula.
    > >
    > > --
    > >
    > > HTH
    > >
    > > RP
    > > (remove nothere from the email address if mailing direct)
    > >
    > >
    > > "Rob" <anonymous@discussions.microsoft.com> wrote in message
    > > news:OiJG40k9EHA.2016@TK2MSFTNGP15.phx.gbl...
    > >> Bob,
    > >>
    > >> I've tried again, this time adding a Vlookup column in my opened text
    > >> file
    > >> that returns 2, the CF add-in is set up likewise to format the cell to

    2
    > >> decimal places. However, there are c. 200 rows and using the CF add-in

    > > copy
    > >> and past function, the reference is always to the initial formula and

    as
    > >> such would take forever to setup each cell condition. That is unless
    > >> there's a VBA method of setting up for each cell.
    > >>
    > >> Regards, Rob
    > >>
    > >> "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
    > >> news:egIVjrk9EHA.1084@TK2MSFTNGP15.phx.gbl...
    > >> > Rob,
    > >> >
    > >> > Sorry, not exactly sure what you mean? It would be the add-in itself

    > > that
    > >> > allows the number format. So, if you had a VLOOKUP in the cell, you

    > > would
    > >> > apply the add-in just like normal CF to test the value, and set the

    > > format
    > >> > accordingly.
    > >> >
    > >> > --
    > >> >
    > >> > HTH
    > >> >
    > >> > RP
    > >> > (remove nothere from the email address if mailing direct)
    > >> >
    > >> >
    > >> > "Rob" <anonymous@discussions.microsoft.com> wrote in message
    > >> > news:OSgEBSk9EHA.1392@tk2msftngp13.phx.gbl...
    > >> >> Bob,
    > >> >>
    > >> >> Great Add-In. However, not allowing the formula Vlookup to look up
    > >> > product
    > >> >> code and apply number format.
    > >> >>
    > >> >> "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
    > >> >> news:e6%237LEk9EHA.3988@TK2MSFTNGP11.phx.gbl...
    > >> >> > The Conditional Formatter add-in,
    > >> >> > http://www.xldynamic.com/source/xld.....Download.html, handles

    > > cell
    > >> >> > formats as well as the usual CF attributes.
    > >> >> >
    > >> >> > --
    > >> >> >
    > >> >> > HTH
    > >> >> >
    > >> >> > RP
    > >> >> > (remove nothere from the email address if mailing direct)
    > >> >> >
    > >> >> >
    > >> >> > "Rob" <anonymous@discussions.microsoft.com> wrote in message
    > >> >> > news:eRucY0j9EHA.2676@TK2MSFTNGP12.phx.gbl...
    > >> >> >> Excel 2000
    > >> >> >>
    > >> >> >> I have two files, one master and one created by opening a text
    > >> >> >> file.
    > >> > The
    > >> >> >> master file has a list of unique product codes and descriptions

    in
    > > two
    > >> >> >> columns, the text that is opened has the product codes and I add
    > >> >> >> during
    > >> >> > the
    > >> >> >> opening process a look up to the product code to return the

    product
    > >> >> >> description, this all works fine. The text file after opening is

    7
    > >> >> > columns,
    > >> >> >> product code, product description and 5 columns of numbers.
    > >> >> >>
    > >> >> >> What I need to do is format the cells (numbers) in the last 5

    > > columns
    > >> > of
    > >> >> > the
    > >> >> >> newly opened text file. My thoughts are to add a third column to

    > > the
    > >> >> > master
    > >> >> >> file whereby I'll have 3 columns: product code, product

    description
    > >> >> >> and
    > >> >> >> number format, in the number format column I would format the

    cell
    > >> >> >> with
    > >> >> > the
    > >> >> >> required number format. My issue is, how using VBA do I format

    the
    > >> > cells
    > >> >> > in
    > >> >> >> the newly opened text file where the product code matches that of

    > > the
    > >> >> >> corresponding product code in the master file. The text file can

    > > have
    > >> >> > many
    > >> >> >> of the same product codes and in some instances, not all of the
    > >> >> >> product
    > >> >> >> codes.
    > >> >> >>
    > >> >> >> I had also thought of Conditioning Format but alas, this doesn't

    > > cover
    > >> >> >> number formatting.
    > >> >> >>
    > >> >> >> Any pointers, snippets of code most welcome.
    > >> >> >>
    > >> >> >> Thanks, Rob
    > >> >> >>
    > >> >> >>
    > >> >> >
    > >> >> >
    > >> >>
    > >> >>
    > >> >
    > >> >
    > >>
    > >>

    > >
    > >

    >
    >




+ 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