Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA question - Inputing data to txtbox in userform using short date formart

Hi,

I intend to get data (in short date format "13-Apr-2004") using txtbo
in a userform.

I tried this code:

Private Sub txtSheet_Change()
' Guarda el numero de Sheet a Importar
Dim Sh As Variant
Sh = Format(txtSheet.Value, dd - mmm - yyyy)
MsgBox "Sheet value=" & Sh
End Sub

but MsgBox apperars inmediatly after each digit.

How can I make nothing appens until I get all the 11 digits, and ho
making sure that data will be only in short date format (dd-mmm-yyyy
?

Thanks

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default VBA question - Inputing data to txtbox in userform using short date formart

You cannot gave the macro in the textbox.change as it will do exactly what you say. i.e. Each digit
is a change to the text box. One solution would be to add a command button to the form and move
your macro to work when the comman button is pressed

DavidP

On Tue, 13 Apr 2004 02:31:01 -0500, ajliaks wrote:

Hi,

I intend to get data (in short date format "13-Apr-2004") using txtbox
in a userform.

I tried this code:

Private Sub txtSheet_Change()
' Guarda el numero de Sheet a Importar
Dim Sh As Variant
Sh = Format(txtSheet.Value, dd - mmm - yyyy)
MsgBox "Sheet value=" & Sh
End Sub

but MsgBox apperars inmediatly after each digit.

How can I make nothing appens until I get all the 11 digits, and how
making sure that data will be only in short date format (dd-mmm-yyyy)
?

Thanks.


---
Message posted from http://www.ExcelForum.com/


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default VBA question - Inputing data to txtbox in userform using short date formart

You could try the Exit or AfterUpdate events.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"ajliaks " wrote in message
...
Hi,

I intend to get data (in short date format "13-Apr-2004") using txtbox
in a userform.

I tried this code:

Private Sub txtSheet_Change()
' Guarda el numero de Sheet a Importar
Dim Sh As Variant
Sh = Format(txtSheet.Value, dd - mmm - yyyy)
MsgBox "Sheet value=" & Sh
End Sub

but MsgBox apperars inmediatly after each digit.

How can I make nothing appens until I get all the 11 digits, and how
making sure that data will be only in short date format (dd-mmm-yyyy)
?

Thanks.


---
Message posted from http://www.ExcelForum.com/



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
Storing data in Short Date format TESA0_4 New Users to Excel 2 July 22nd 08 01:25 AM
help to show formart in reference cell jiang Excel Worksheet Functions 4 November 23rd 04 03:29 PM
VBA: Update worksheet when txtBox data changes. Mcasteel Excel Worksheet Functions 2 November 14th 04 11:59 PM
VBA: Update worksheet when txtBox data changes. Mcasteel Excel Worksheet Functions 1 November 13th 04 03:19 PM
VBA: Update worksheet when txtBox data changes. Mcasteel Excel Worksheet Functions 1 November 1st 04 06:18 PM


All times are GMT +1. The time now is 06:43 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"