|
-
Aug 26th, 2009, 06:37 AM
#1
Thread Starter
Addicted Member
[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.
-
Aug 26th, 2009, 06:50 AM
#2
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
-
Aug 26th, 2009, 07:13 AM
#3
Re: find sheets in html from excel workbook
vb Code:
for each w in workbooks 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
-
Aug 26th, 2009, 07:47 AM
#4
Thread Starter
Addicted Member
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
-
Aug 26th, 2009, 07:55 AM
#5
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:
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
-
Aug 27th, 2009, 05:29 AM
#6
Thread Starter
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|