Results 1 to 6 of 6

Thread: [RESOLVED] find sheets in html from excel workbook

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2009
    Location
    Townsville, Qld, Australia
    Posts
    135

    Resolved [RESOLVED] find sheets in html from excel workbook

    I am trying to put together something that will take a couple of manky spread sheets and combine them into one neat summary. The manky spread sheets are the result of a data export from a web-based program. As far as Excel is concerned, these spread sheets are in html.

    I need a sub routine that selects the correct sheet so that it can be cleaned up. If I manually move the sheet into the workbook where I’ve got the subs a simple

    For each spreadsheet in Sheets
    If...

    routine selects the right sheet, but I need a way of searching outside the work book, so that the user doesn’t need to move the spread sheets manually.

    When the spread sheets are down-loaded their names are essentially random.

    The sub routine needs to work in Excel 2003.

  2. #2
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: find sheets in html from excel workbook

    Three things...

    1) What code do you have so far?

    2) Show us a sample of the "manky spread sheets"

    3) Also show us how do you expect the summary to look?
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

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

    Re: find sheets in html from excel workbook

    vb Code:
    1. for each w in workbooks
    2.     for each s in w.sheets
    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

    Thread Starter
    Addicted Member
    Join Date
    Jun 2009
    Location
    Townsville, Qld, Australia
    Posts
    135

    Smile Re: find sheets in html from excel workbook

    Once I've selected the sheet, I've got the code that cleans it up working nicely. The clean-up involves unmerging all cells, deleting unwanted columns, deleting blank rows and a bit of formatting - and naming the sheet!

    The second sheet gets a similar clean-up and then I've got a third lot of code that populates the first sheet with data from the second.

    I'll try your code at work tomorrow - this is a work project but I can't log in to VB Forums at work.

    My only other unsolved problem with this project is including today's date in the file-name when I save the nice, clean summary sheet.

    Thank you

  5. #5
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: find sheets in html from excel workbook

    My only other unsolved problem with this project is including today's date in the file-name when I save the nice, clean summary sheet.
    vb Code:
    1. Strname = Format(Now,"DD-MM-YYYY")

    You can then use Strname in the name of the sheet.
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Jun 2009
    Location
    Townsville, Qld, Australia
    Posts
    135

    Re: find sheets in html from excel workbook

    Thanks, the
    for each w in workbooks
    for each s in w.sheets
    code does the trick. I'll try koolsid's date solution & see if I can get it to work tomorrow.

Tags for this Thread

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