Re: Excel Tutorials and XL Function library
Posted: 27 Apr 2022, 18:13
Man, this is really useful! I was struggling for about the course of a day trying to cobble together some basic Excel functions like opening and activating a workbook, binding to a workbook, alternating through worksheets, getting the last used cell in a column... The last issue I had just overcome before stumbling upon this again was causing Excel to spit out the displayed text and not the stored text in a cell.
Particularly I needed Excel to hold onto a date formatted for 10 digits(IE "01/22/2023") or 8 digits (IE "01222023"). Excel has some formatting features that got my date strings looking right on the cell, but not when it came time to copy the content into a var and pass that to a website. The date string would go from 8 digit formatting to short date formatting(IE "10/2/22") which is not what I want. After reading over another post on this same forum I discovered another user had taken advantage of the .Text property of the cells they were working with.
I changed my command from to and now I can properly retrieve my 8 digit dates!!
I've been struggling with this tidbit of an issue for the better half of two hours now.
Thank you very much, @Joe Glines
Particularly I needed Excel to hold onto a date formatted for 10 digits(IE "01/22/2023") or 8 digits (IE "01222023"). Excel has some formatting features that got my date strings looking right on the cell, but not when it came time to copy the content into a var and pass that to a website. The date string would go from 8 digit formatting to short date formatting(IE "10/2/22") which is not what I want. After reading over another post on this same forum I discovered another user had taken advantage of the .Text property of the cells they were working with.
I changed my command from
Code: Select all
range("A1").Value
Code: Select all
range("A1").Text
I've been struggling with this tidbit of an issue for the better half of two hours now.
Thank you very much, @Joe Glines