Helo All,
how to import my html file to excel sheet by macros? excluding "H" column in Excel sheet. because "H" Column needs Sqrt Formula.
Thanks for any help...
Helo All,
how to import my html file to excel sheet by macros? excluding "H" column in Excel sheet. because "H" Column needs Sqrt Formula.
Thanks for any help...
Last edited by raje; 11-22-2017 at 12:44 PM. Reason: Sample files and procedure updated
Hi Folks...
looking for help..
Thank you..
Helo frnds..any help?
Thank you...
At first glance I see no direct relationship between 2 files in attached zip archive
Best Regards,
Kaper
Dear Kaper thank you for responding. relation is some data extracted from html notepad file to excel. because i have struggled every time searching words in html file like "Column No" , "Analysis No", Soil Bearing Capacity" etc... and copied manually respective numerical values to excel sheet. here i am attached updated sample files.
please have a look..
Thank you...
Last edited by raje; 11-22-2017 at 12:51 PM. Reason: Description updated
Oi, this is horrid html code with nested table tags with no ID...
Will structure always remain same? And will always contain same info?
I ask, since only C1 has "Permissible area of loss of contact" info.
?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
― Robert A. Heinlein
Helo CK76..
yes that format remains constant in html (This structure always remain same in html) if data increase. same format and column numbers like C1, C2 etc increased may be up to 200 (Like C200).
"Permissible area of loss of contact" values no need to excel. only specified format of excel enough my assignments.
Because in my sample file excel format showing only 3 Rows data only...actually my work is C1,C2, and up to C30 to C200 some times.
so please help me for automate the process.
Thank you..
Last edited by raje; 11-22-2017 at 01:28 PM.
Here's sample code to grab string data within the table. From here, you will need either string manipulation or RegExp pattern matching.
Notes:
1. You will need to add reference to Microsoft HTML Object library
2. Change fPath as needed.
3. Will only work on Windows based machine.
Edit - Can you confirm that you can at least get result from this code? Then I'll think on logic to move from there...Please Login or Register to view this content.
Last edited by CK76; 11-22-2017 at 01:30 PM. Reason: See Edit
Thq Ck...
showing errors..how to edit for required paste values for respective cells? i will try..
Thq CK,
Best wishes..
This is just intermediate step, just check the Immediate window in VBE, no value is pasted into cell.
And what error message comes up at which line of the code? Did you change fPath to your actual file path of html file?
Once you confirm that you can at least run this initial code, then I'll think on next step. It is rather painful, since majority of HTML tags in the file has no class/ID assigned to it.
Hence, the need for RegExp or String Manipulation after all .innerText of the table has been read.
Here, had a bit of time. This does what you are looking for. Based on patterns found in your sample file. Don't know if it will match all patterns if there are more (some patterns changed within same file).
Again, change fPath as needed.
See attached file.
Can't post code because of SQL injection. But you will find the code in attached text as well as Module1 of attached.
Helo CK76,
thank you for spending time for me and it is nicely working. my request is at "H" column formula pasted as Sqrt(G). like Sqrt(G4) etc..can you add this one to your code?
Thank you for helping.
Do you need the formula? Or just the result in column H.
need formula with two decimals roundup (Ex:4.47, 2.30 etc)
In that case, just put below code after "End With".
Please Login or Register to view this content.
Thank you CK76...working. my final request is show popup window for select html file..any possibility?
Last edited by raje; 11-23-2017 at 10:40 AM.
Sure use function below to pick a file and return full file path.
And change original code above "Open fPath For..." line to...Please Login or Register to view this content.
Change folder path, as you wish for FilePicked function.Please Login or Register to view this content.
See attached.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks