Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Date problems

2003

I dim all the cells as Date 03/14/01
I dim the transferring variable as date
When I do variable = cell and then to the newcell = variable it doesn't
work. It looks like ######### until I try to format it and then it is
nonsense.

I want to pick a date out of one cell and put it into a cell on another
sheet. How do I do that so it looks right?

Thanks

John

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Date problems

Dim destCell as Range
set destcell = Worksheets("Sheet2").Range("B9")
with Worksheets("Sheet1").Range("F11")
destcell.value = .Value
destcell.Numberformat = .Numberformat
End With

or
Dim destCell as Range
set destcell = Worksheets("Sheet2").Range("B9")
Worksheets("Sheet1").Range("F11") _
.copy Destination:=destcell


--
Regards,
Tom Ogilvy


"John" wrote in message
...
2003

I dim all the cells as Date 03/14/01
I dim the transferring variable as date
When I do variable = cell and then to the newcell = variable it doesn't
work. It looks like ######### until I try to format it and then it is
nonsense.

I want to pick a date out of one cell and put it into a cell on another
sheet. How do I do that so it looks right?

Thanks

John



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Date problems

I misspoke... I don't dim the cells I format the date columns in each
worksheet before running the macro. I only dim the variable used for
transferring. So I format all the cells in all the worksheets the same
(Date 03/14/01) and then dim a variable to Date. Using that variable to
pass dates from one sheet to another isn't working.

Thanks


The worksheets are pre formatted worksheets. I am filling them out by
referencing other sheets.

Each sheet is date and charges incurred. The master sheet collects these
for presentation.

Tom Ogilvy wrote:

Dim destCell as Range
set destcell = Worksheets("Sheet2").Range("B9")
with Worksheets("Sheet1").Range("F11")
destcell.value = .Value
destcell.Numberformat = .Numberformat
End With

or
Dim destCell as Range
set destcell = Worksheets("Sheet2").Range("B9")
Worksheets("Sheet1").Range("F11") _
.copy Destination:=destcell



--
R-e-t-u-r-n A-d-d-r-e-s-s I-n-s-t-r-u-c-t-i-o-n-s
Change LID to

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Date problems

Sorry, guess you didn't want an answer.

--
Regards,
Tom Ogilvy

"John" wrote in message
...
I misspoke... I don't dim the cells I format the date columns in each
worksheet before running the macro. I only dim the variable used for
transferring. So I format all the cells in all the worksheets the same
(Date 03/14/01) and then dim a variable to Date. Using that variable to
pass dates from one sheet to another isn't working.

Thanks


The worksheets are pre formatted worksheets. I am filling them out by
referencing other sheets.

Each sheet is date and charges incurred. The master sheet collects these
for presentation.

Tom Ogilvy wrote:

Dim destCell as Range
set destcell = Worksheets("Sheet2").Range("B9")
with Worksheets("Sheet1").Range("F11")
destcell.value = .Value
destcell.Numberformat = .Numberformat
End With

or
Dim destCell as Range
set destcell = Worksheets("Sheet2").Range("B9")
Worksheets("Sheet1").Range("F11") _
.copy Destination:=destcell



--
R-e-t-u-r-n A-d-d-r-e-s-s I-n-s-t-r-u-c-t-i-o-n-s
Change LID to



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Date problems

turned out I was trying to pull the date from the wrong(empty) cell, sorry
John

Tom Ogilvy wrote:
Sorry, guess you didn't want an answer.


--
R-e-t-u-r-n A-d-d-r-e-s-s I-n-s-t-r-u-c-t-i-o-n-s
Change LID to

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date problems Gerry[_2_] Setting up and Configuration of Excel 1 September 28th 07 12:42 PM
date problems piute Excel Discussion (Misc queries) 14 December 7th 06 03:22 PM
Date problems, is it a bug??? R-P Excel Discussion (Misc queries) 4 August 18th 06 03:40 PM
Date problems MrEMann Excel Worksheet Functions 4 August 25th 05 04:42 PM
Date Problems MikePiehl Charts and Charting in Excel 2 June 2nd 05 05:45 PM


All times are GMT +1. The time now is 08:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"