LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 41
Default Excel changing date format after VB has run

Hi

I have a sheet 1 with a combo box and a blank field. When something
is selected from the combo box a date gets populated in the blank
field. The date is custom formatted as mmm-yyyy.

On sheet 2 I have a table with the options in the drop down box and a
date next to them. When a selection is done, the code does a VLOOKUP
and populates the data in Sheet 1 in the blank field. Dates are also
mmm-yyyy in the Sheet 2.

The problem is, say the date in Sheet 2 is 01/12/2010 displayed as
Dec-2010. When it is put into sheet w, it flips it to 12/01/2010 so
says Jan-2010. Any idea why this is happening please?

Code Below - VersionRange is a named Range ($C$4:$F$56) in Sheet 2

Dim boxdate
Dim VerValue
Dim VerRange
Dim ws As Worksheet

Set ws = Worksheets("Sheet 2")
VerValue = Combo1.Text
VerRange = ws.Range("VersionRange")

If VerValue = "" Then
boxdate= ""
Else: boxdate = Application.WorksheetFunction.VLookup(VerValue,
VerRange, 2)
End If

Range("A19").Select
ActiveCell.FormulaR1C1 = boxdate


Thank you

Rich
 
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
Changing the date format on the date table in a chart spudsnruf Charts and Charting in Excel 2 September 3rd 09 07:08 PM
Excel 2003 - Changing Date Format oceanmist Excel Discussion (Misc queries) 3 August 2nd 07 07:59 PM
Excel 2002 - Date format keeps changing B. Levien Excel Discussion (Misc queries) 0 February 6th 06 09:35 PM
Changing to date format Peretz Stern Excel Discussion (Misc queries) 6 December 29th 05 08:13 PM
excel is changing date format hubbo Setting up and Configuration of Excel 1 May 18th 05 08:07 PM


All times are GMT +1. The time now is 06:35 PM.

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

About Us

"It's about Microsoft Excel"