+ Reply to Thread
Results 1 to 3 of 3

How to set active cell + date formatting

  1. #1
    Registered User
    Join Date
    11-10-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    2

    How to set active cell + date formatting

    Hi everyone,
    I have two very simple questions that I need help with.

    1) I added buttons to my excel worksheet. When I press the button, it calls a VBA routine. When the routine is called, I want to set the ActiveCell to the cell which contains the button. May I know how I can do this?

    2) I read a cell containing a date field and pasted it into another cell. I don't know why the formatting isn't coming our right. My code is:

    Range("H2").Offset(row_count, column_count).Value = Format(transaction_date, "dd mmm yy")

    No matter what I set the format string to, the date always comes out like this: "5/25/2011" (for 25th May 2011). I want it to appear like this: "25-May-11"

    Thanks!
    Last edited by PepperCrab; 11-10-2011 at 10:01 AM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: How to set active cell + date formatting

    Place this code in a "Forms" Button
    Please Login or Register  to view this content.
    There are possibly better ways to do this then working with buttons such as a worksheet event.

  3. #3
    Registered User
    Join Date
    11-10-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: How to set active cell + date formatting

    Thanks very much!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1