PDA

View Full Version : Date & time problem



gussi
08-01-2007, 05:09 PM
Hi guys,
I?m having problem with date & time.

I Have ? Combo box (Forms) which i?ve set up so I can choose date back in time from Data which i have in one Sheet.

Dim index As Integer
index = Cells(2,7)

Dim ticker As String
ticker = Cells(index + 1, 6)

In the combo box. I right clicked and picked the series of my dates and set the other thing as the index. Then i can click on the side of the combo box and choose these dates.
So when I?ve chosen the date, let?s say 1.4.2006 then i have to click on a CommandButton (Control).
That?s the problem when i click on that button, i have to make some code so the button knows whats in that combo box and go to lets say Sheet3 and pick out this date 1.4.2006 (which can be few rows) and copy them to a new sheet, let?s say Sheet4. (So i need some kind of loop also).

Another thing which can be problem is that the column looks like this: ,,1.4.2006 11:49:40", but the time dosen?t matter, only the date.

Can somebody help my with this?:help

Regards,
Gussi

gussi
08-02-2007, 02:20 AM
The Code in the former post is wrong..
It?s like this

Private Sub Get_Click() 'this is the CommandButton

Dim index as Integer
index = Sheet2.Cells(2,8)

Dim ticker As String
ticker = Sheet2.Cells(1 + index, 7)

Dim strNameOfWindow As String
strNameOfWindow = ticker + ?????

This is the code behind my combo box and Command button. So when i?m getting another file there is ".xls" instead of ??????.
But I?m making a new one so i can go into sheet3 and get the date which i choose in my combo box by clicking on the command button and paste those sequences in sheet4.

Need help...

gussi
08-02-2007, 06:41 AM
:help :help :help :help :help :help :think: