Results 1 to 4 of 4

Thread: [Excel] Finding all hex values between 2 ranges.

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2017
    Posts
    18

    Question [Excel] Finding all hex values between 2 ranges.

    Hi All

    I am looking for a bit of help I am a VB virgin so please bear with me.

    How do I create a script in Excel to find all the values between 2 different Hex ranges.

    For example I have 6203DC8 and 6203DE1 I know there are 25 values between these ranges.

    What I would like is a marco which would list them all I will be looking to do about 1000 at a time hex value will always be different.

    Example.

    6203DC8
    6203DC9
    6203DCA
    6203DCB
    6203DCC
    6203DCD
    6203DCE
    6203DCF
    6203DD0
    6203DD1
    6203DD2
    6203DD3
    6203DD4
    6203DD5
    6203DD6
    6203DD7
    6203DD8
    6203DD9
    6203DDA
    6203DDB
    6203DDC
    6203DDD
    6203DDE
    6203DDF
    6203DE0


    Any help would be great.

    Regards
    Derek

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,710

    Re: [Excel] Finding all hex values between 2 ranges.

    Welcome to teh Forums.

    So if you just want to do a math calculation on a 2 hex numbers?

    Cell formula:
    Code:
    =ABS(SUM(HEX2DEC(A1))-HEX2DEC(A25))
    In a cell to give you a total where A1 and A25 contain the first and last sequential hex numbers to calculate
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: [Excel] Finding all hex values between 2 ranges.

    if you just want to list the numbers, try like
    Code:
    For i = &H6203DC8 To &H6203DE0
        Debug.Print Hex(i)
    Next
    change the debug.print to whatever output you want
    you can use textbox or cell value instead of hardcoding the start and finish values
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,710

    Re: [Excel] Finding all hex values between 2 ranges.

    Ah missed the list them all part of the question. I thought it was how to calculate the numbers between two hex numbers
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Posting Permissions

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



Click Here to Expand Forum to Full Width