View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default ListBox Question

I set up a listbox2 on the worksheet and set the listfillrange property to
A1:A6. I put your formulas in A1:A6 and formatted the cells as date.

I put in a click event:

Private Sub ListBox2_Click()
NextRow = _
Application.WorksheetFunction.CountA(Range("A:A")) + 1
Cells(NextRow, 2) = ListBox2.Text

End Sub

It placed the values in the cell with no problem (as long as I formatted the
cell as data, it appeared as the selected date).

This was a listbox from the control toolbox toolbar.

--
Regards,
Tom Ogilvy


Randal W. Hozeski wrote in message
...

Tom:
Thanks!!! the listindex was it (for the sub-issue)

The core issue on ListBox2 still remains.
Range of ListBox2 are formulas.

Cell A1 is: =NOW()-28-WEEKDAY(NOW())
A2: =NOW()-21-WEEKDAY(NOW())
A3: =NOW()-14-WEEKDAY(NOW())
A4: =NOW()-7-WEEKDAY(NOW())
A5: =NOW()-WEEKDAY(NOW())
A6: =NOW()+7-WEEKDAY(NOW())

Range = A1:A6 or I am calling it "Dates". ListBox2
shows. 11/15/03, 11/22/03, 11/29/03, 12/06/03
12/13/03 and 12/20/03.
ColumnCount confirmed @ 1 and no Error handling in
this sub.

I considered trying a SpinButton to display the dates
but this is just as good.

I bit more detail.... hope it help resolve.
Thanks -Randy-

.







*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!