+ Reply to Thread
Results 1 to 2 of 2

Ranges of Named Fields

  1. #1
    affordsol
    Guest

    Ranges of Named Fields

    Hi to all !

    In Excel 97, I try to get the range of the existing fields : by example

    FieldName range
    namedProf Param2!$A$1:$A$50

    I use the following code :
    Dim intPtr1 As Integer
    '
    Sheets("Content").Select
    Range("G2").Activate
    ActiveCell = "NamedFields"
    For intPtr1 = 1 To Application.ActiveWorkbook.Names.Count
    ActiveCell.Offset(intPtr1, 1) =
    Application.ActiveWorkbook.Names(intPtr1).Name
    ActiveCell.Offset(intPtr1, 2) = Names(intPtr1).RefersTo
    Next intPtr1

    but the results are not OK

    Can anyone help ??

    Thanks by advance and regards from Belgium.



  2. #2
    Tom Ogilvy
    Guest

    Re: Ranges of Named Fields

    if you trying to write a list of names and there refers to

    Dim intPtr1 As Integer
    '
    Sheets("Content").Select
    Range("G2").Activate
    ActiveCell = "NamedFields"
    For intPtr1 = 1 To Application.ActiveWorkbook.Names.Count
    ActiveCell.Offset(intPtr1, 1) =
    Application.ActiveWorkbook.Names(intPtr1).Name
    ActiveCell.Offset(intPtr1, 2) = "'" & Names(intPtr1).RefersTo
    Next intPtr1
    Next

    or you could try

    Sheets("Content").Select
    Range("G2").Activate
    Selection.ListNames

    --
    Regards,
    Tom Ogilvy


    "affordsol" <[email protected]> wrote in message
    news:[email protected]...
    > Hi to all !
    >
    > In Excel 97, I try to get the range of the existing fields : by example
    >
    > FieldName range
    > namedProf Param2!$A$1:$A$50
    >
    > I use the following code :
    > Dim intPtr1 As Integer
    > '
    > Sheets("Content").Select
    > Range("G2").Activate
    > ActiveCell = "NamedFields"
    > For intPtr1 = 1 To Application.ActiveWorkbook.Names.Count
    > ActiveCell.Offset(intPtr1, 1) =
    > Application.ActiveWorkbook.Names(intPtr1).Name
    > ActiveCell.Offset(intPtr1, 2) = Names(intPtr1).RefersTo
    > Next intPtr1
    >
    > but the results are not OK
    >
    > Can anyone help ??
    >
    > Thanks by advance and regards from Belgium.
    >
    >




+ 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