Results 1 to 6 of 6
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cell('Type') (97:SR2)

    Is there code equivalent to: =Cell("Type",A1")

    I have been looking through the MSHelp but can't seem to find it. I have also tried application.worksheetfunction

    Thanks,
    John

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Cell('Type') (97:SR2)

    Not exactly, but many of the same properties returned are Properties of <cell>.Range, though the return values differ. Application.WorksheetFunction.Cell("property",rang e) should return the same results as when used in a spreadsheet cell.
    -John ... I float in liquid gardens
    UTC -7ąDS

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Cell('Type') (97:SR2)

    John,

    In XL97 there is no function for "Cell". I may be missing something.

    John

  4. #4
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Cell('Type') (97:SR2)

    You are correct it is not available to VB in XL97 (perhaps not in the others either).

    You could create your own

    <pre>Function CellType(rCell As Range) As String
    CellType = "v"
    If IsEmpty(rCell.Cells(1)) Then CellType = "b"
    If Application.WorksheetFunction.IsText(rCell.Cells(1 ).Value) Then _
    CellType = "l"
    End Function</pre>


    You could, of course, add more types to test (formula, error, etc), this just matches the cell("type") function in excel.

    Steve

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Cell('Type') (97:SR2)

    FYI, Cell is not a method of the WorksheetFunction object in Excel 2002 VBA either.

  6. #6
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Cell('Type') (97:SR2)

    No, and sorry for the delayed reply. <img src=/S/grovel.gif border=0 alt=grovel width=31 height=23> I am wrong, Steve is correct, CELL(,) is not a valid Application.WorksheetFunction Method.
    -John ... I float in liquid gardens
    UTC -7ąDS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •