+ Reply to Thread
Results 1 to 3 of 3

Assign a type to a selected portions

  1. #1
    Registered User
    Join Date
    04-13-2018
    Location
    SG
    MS-Off Ver
    Excel 2016
    Posts
    2

    Assign a type to a selected portions

    Is it possible to output a type as "int" if we select from say A1:A5, contains (1,2,3,4,5);
    but output a type as "string" if we have (1,2,hello,4,5)

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Assign a type to a selected portions

    Sure, use ISNUMBER() function true is numeric false is something else but then for each cell in the chosen range,
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,899

    Re: Assign a type to a selected portions

    Try:

    =IF(ISERROR(SUMPRODUCT(A1:A5+0)),"string","int")

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Assign Data Type to Array Dimension
    By JYTS in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-23-2016, 06:15 PM
  2. [SOLVED] how can I assign the first and the last row of a selected range to variables ?
    By dschmitt in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-19-2015, 10:40 PM
  3. [SOLVED] how can I assign the first and the last row of a selected range to variables ?
    By dschmitt in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-19-2015, 10:38 PM
  4. [SOLVED] Assign same value to selected cells within the same group
    By Ucpaul in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-29-2014, 11:41 PM
  5. [SOLVED] assign different chart line type under different condition with vba
    By DavidRoger in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-30-2013, 08:51 PM
  6. Assign only selected worksheets to a variable
    By huyeote1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-21-2009, 11:10 PM
  7. selected option button assign 1 to a cell and others 0
    By hjk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-16-2007, 03:27 PM

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