+ Reply to Thread
Results 1 to 6 of 6

if between two numbers

  1. #1
    Registered User
    Join Date
    12-17-2008
    Location
    edinburgh, uk
    Posts
    46

    Question if between two numbers

    Hi Guys,
    Bit stuck on something. Basically I've got a sheet with 3 columns ....

    a - the name of a zone ... b and c are two numbers. there are 22 rows in this sheet (say sheet1)

    I have another sheet (sheet2) with an unknown number of rows (will change). one of the columns (say F) has a number in it. If this number is between columns B and C in sheet1 then i want sheet2 column D to = sheet1 column a

    quite complicated to explain sorry! anyway here's the code i've done but i get object required error at the "Set CheckCells = Sheet.CMDB.UsedRange" line


    Please Login or Register  to view this content.
    Last edited by mattmac; 01-20-2011 at 05:32 AM.

  2. #2
    Forum Contributor
    Join Date
    09-23-2008
    Location
    Mexico
    Posts
    200

    Re: if between two numbers

    See if this helps:
    http://www.mrexcel.com/forum/showthr...aracter+number
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-17-2008
    Location
    edinburgh, uk
    Posts
    46

    Re: if between two numbers

    Ok thanks for that... i've changed my code.

    Getting an overflow at INCR = INCR + 1

    Please Login or Register  to view this content.

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: if between two numbers

    I've not reviewed the code but change INCR to Long (from Integer).

    Row numbers can exceed Integer's upper bounday (32767)

  5. #5
    Registered User
    Join Date
    12-17-2008
    Location
    edinburgh, uk
    Posts
    46

    Re: if between two numbers

    Thanks, changed that and I'm no longer getting an overflow.

    Code still isn't doing what I want it to though, infact it's not doing anything

  6. #6
    Registered User
    Join Date
    12-17-2008
    Location
    edinburgh, uk
    Posts
    46

    Re: if between two numbers

    Updated code but it's still not working

    Basically it's just copying cells 1 to 22 from the CMDB sheet and pasting them in the SDC_PROC sheet in D2 - D23. Not sure what I've done wrong

    Please Login or Register  to view this content.
    Last edited by mattmac; 01-24-2011 at 07:47 AM. Reason: updated code

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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