ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   EXCEL: VBE code for a push-down stack (Date,Value1,.....) (https://www.excelbanter.com/excel-programming/372067-excel-vbe-code-push-down-stack-date-value1.html)

Joe Bailey[_2_]

EXCEL: VBE code for a push-down stack (Date,Value1,.....)
 
Need a VBE coding example for a push-down stack that would contain the date
plus several data ites for that date, where the date is like a timestamp....

Dave Patrick

EXCEL: VBE code for a push-down stack (Date,Value1,.....)
 
You might have better luck if you can describe what a "push-down stack" is
and what you would like it to do.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Joe Bailey" wrote:
| Need a VBE coding example for a push-down stack that would contain the
date
| plus several data ites for that date, where the date is like a
timestamp....



Joe Bailey[_2_]

EXCEL: VBE code for a push-down stack (Date,Value1,.....)
 
OK, what I mean by a push-down stack:
Consider a list
DATE AccountAlpha AccountBeta etc.....
03-Sep-06 14,262.00 5,447.00
02-Sep-06 11,197.00 5,317.00
01-Sep-06 12,117.00 5,326.00

Today is the04-Sep-06, and todays account values need to be inserted at the
top of the list. Step 1 - push down stack; Step 2 Insert toays data
DATE AccountAlpha AccountBeta etc.....
vvvvvvvvv push-down stack vvvvvvv<<<< insert 04-Sep-06, 13767, 5842
03-Sep-06 14,262.00 5,447.00
02-Sep-06 11,197.00 5,317.00
01-Sep-06 12,117.00 5,326.00

With the resulting updated stack now shows
DATE AccountAlpha AccountBeta etc.....
04-Sep-06 13,767.00 5,842.00
03-Sep-06 14,262.00 5,447.00
02-Sep-06 11,197.00 5,317.00
01-Sep-06 12,117.00 5,326.00

"Dave Patrick" wrote:

You might have better luck if you can describe what a "push-down stack" is
and what you would like it to do.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Joe Bailey" wrote:
| Need a VBE coding example for a push-down stack that would contain the
date
| plus several data ites for that date, where the date is like a
timestamp....




Dave Patrick

EXCEL: VBE code for a push-down stack (Date,Value1,.....)
 
Your code just needs to insert a row before you write to it.

Rows("1:1").Insert xlDown

I'd consider moving this to Access where the order of records doesn't
matter. You query the database and use an ORDER BY clause to determine how
the records are sorted.


--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Joe Bailey" wrote:
| OK, what I mean by a push-down stack:
| Consider a list
| DATE AccountAlpha AccountBeta etc.....
| 03-Sep-06 14,262.00 5,447.00
| 02-Sep-06 11,197.00 5,317.00
| 01-Sep-06 12,117.00 5,326.00
|
| Today is the04-Sep-06, and todays account values need to be inserted at
the
| top of the list. Step 1 - push down stack; Step 2 Insert toays data
| DATE AccountAlpha AccountBeta etc.....
| vvvvvvvvv push-down stack vvvvvvv<<<< insert 04-Sep-06, 13767, 5842
| 03-Sep-06 14,262.00 5,447.00
| 02-Sep-06 11,197.00 5,317.00
| 01-Sep-06 12,117.00 5,326.00
|
| With the resulting updated stack now shows
| DATE AccountAlpha AccountBeta etc.....
| 04-Sep-06 13,767.00 5,842.00
| 03-Sep-06 14,262.00 5,447.00
| 02-Sep-06 11,197.00 5,317.00
| 01-Sep-06 12,117.00 5,326.00




All times are GMT +1. The time now is 03:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com