Results 1 to 5 of 5

Thread: please help in grouping rows of excel throgh vb6.0 code

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2005
    Posts
    4

    Thumbs up please help in grouping rows of excel throgh vb6.0 code

    i have generated an excel sheet through vb 6.0
    it contains four columns and 200 rows
    now i want to group the rows on one clolumn which is fx currency
    for eg
    if 100 rows contains usd as fx curr
    i have to group the rows
    and if next 100 rows contains euro as fx curr
    i have to group these rows
    please help in this

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

    Re: please help in grouping rows of excel throgh vb6.0 code

    Welcome to the Forums.

    Moved from CodeBank.
    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
    Frenzied Member zaza's Avatar
    Join Date
    Apr 2001
    Location
    Borneo Rainforest Habits: Scratching
    Posts
    1,486

    Re: please help in grouping rows of excel throgh vb6.0 code

    You could sort:

    VB Code:
    1. Range("A1:D200").sort("A:A")

    which will change the rows around, or to only display certain types at any one time just set a filter (select the first column, then Tools, Autofilter).

    zaza

  4. #4
    Frenzied Member
    Join Date
    May 2004
    Location
    Carlisle, PA
    Posts
    1,045

    Re: please help in grouping rows of excel throgh vb6.0 code

    How is the currency identified? Where is the identification?
    Blessings in abundance,
    All the Best,
    & ENJOY!

    Art . . . . Carlisle, PA . . USA

  5. #5
    Frenzied Member zaza's Avatar
    Join Date
    Apr 2001
    Location
    Borneo Rainforest Habits: Scratching
    Posts
    1,486

    Re: please help in grouping rows of excel throgh vb6.0 code

    Hi,

    I may have misunderstood earlier - do you have the currency typed in as text ("Euro", "£", "$") or is it the formatting of the cell?

    if the latter, then you could do something like the following in a button:
    Assuming your data is in cells B1:E200

    VB Code:
    1. for i = 1 to 200
    2.  cells(i,1) = cells(i,2).numberformat
    3.  next i
    4.  
    5. range("A1:E200").sort Key1:=range("A1:a200")

    You could make column A hidden or thin or in white text, if you liked...

    HTH

    zaza

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