Get Month name from Date value in cell


"Excel VBA Help"

 


Play Friv Now - Play Friv Games
Go Back   The Code Cage Forums > Microsoft Topics > Microsoft Excel Forum
Our Info Pages:-
The Code Cage - Microsoft Office help

Notices

Microsoft Excel Forum Members Post questions in this forum if they are related to using Microsoft Excel, this includes Worksheet Functions, Excel VBA Programming, Simple Macro Code & Charting, Excel formula etc.

New Reply
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1  
Unread 18th April 2010, 23:06
Chip Dukes's Avatar
Chip Dukes
Newsgroup Contributor
 
Posts: n/a
Posts Per Day: 0
My Top Tip Count:
Default Get Month name from Date value in cell
     Excel: VBA   


I'm trying to get the month from a date representation as follows ...
VBA CODE:
Private Sub Worksheet_Change(ByVal Target As Range) 
     
    If Target.Column = 3 And Target.Cells.Count = 1 Then 
        Dim strDate As String 
        strDate = Format(Target.Value, "mmmm") 
        Range("A20").Value = strDate 
    Else 
        Exit Sub 
    End If 
     
End Sub 
The error I am getting is ... "Object Required"

on the ... strDate = Format(Target.Value, "mmmm") ...

line

by which I'm guessing Target.Value is not being seen as a date type ...

Any ideas as to how I could get the month from a value entered into a call
.... the value will always be in the form 5/24/55 ... from which I need the
string "May"

Chip Dukes
(New to Excel programming)


Last edited by RoyUK; 11th May 2010 at 18:23.
The Code Cage Advertisment
Advertisement
  #2  
Unread 18th April 2010, 23:30
JLatham's Avatar
JLatham
Newsgroup Contributor
 
Posts: n/a
Posts Per Day: 0
My Top Tip Count:
Default RE: Get Month name from Date value in cell

------ Register to get rid of these "In Post" ads! ------


Warning

Warning



Sorry but you need to register for FREE to see the rest of these posts. Please click HERE to register.

We only allow guests to see the first post of every thread to keep valuable resources for our members.






  #3  
Unread 18th April 2010, 23:30
Barb Reinhardt's Avatar
Barb Reinhardt
Newsgroup Contributor
 
Posts: n/a
Posts Per Day: 0
My Top Tip Count:
Default RE: Get Month name from Date value in cell

------ Register to get rid of these "In Post" ads! ------


Warning

Warning



Sorry but you need to register for FREE to see the rest of these posts. Please click HERE to register.

We only allow guests to see the first post of every thread to keep valuable resources for our members.






The Code Cage Advertisment
Advertisement
  #4  
Unread 18th April 2010, 23:30
Barb Reinhardt's Avatar
Barb Reinhardt
Newsgroup Contributor
 
Posts: n/a
Posts Per Day: 0
My Top Tip Count:
Default RE: Get Month name from Date value in cell

------ Register to get rid of these "In Post" ads! ------


Warning

Warning



Sorry but you need to register for FREE to see the rest of these posts. Please click HERE to register.

We only allow guests to see the first post of every thread to keep valuable resources for our members.






  #5  
Unread 18th April 2010, 23:30
FSt1's Avatar
FSt1
Newsgroup Contributor
 
Posts: n/a
Posts Per Day: 0
My Top Tip Count:
Default RE: Get Month name from Date value in cell

------ Register to get rid of these "In Post" ads! ------


Warning

Warning



Sorry but you need to register for FREE to see the rest of these posts. Please click HERE to register.

We only allow guests to see the first post of every thread to keep valuable resources for our members.






  #6  
Unread 18th April 2010, 23:40
Joe User's Avatar
Joe User
Newsgroup Contributor
 
Posts: n/a
Posts Per Day: 0
My Top Tip Count:
Default RE: Get Month name from Date value in cell

------ Register to get rid of these "In Post" ads! ------


Warning

Warning



Sorry but you need to register for FREE to see the rest of these posts. Please click HERE to register.

We only allow guests to see the first post of every thread to keep valuable resources for our members.






The Code Cage Advertisment
Advertisement
  #7  
Unread 18th April 2010, 23:50
Steve Yandl's Avatar
Steve Yandl
Newsgroup Contributor
 
Posts: n/a
Posts Per Day: 0
My Top Tip Count:
Default Re: Get Month name from Date value in cell

------ Register to get rid of these "In Post" ads! ------


Warning

Warning



Sorry but you need to register for FREE to see the rest of these posts. Please click HERE to register.

We only allow guests to see the first post of every thread to keep valuable resources for our members.






  #8  
Unread 19th April 2010, 01:25
Rick Rothstein's Avatar
Rick Rothstein
Newsgroup Contributor
 
Posts: n/a
Posts Per Day: 0
My Top Tip Count:
Default Re: Get Month name from Date value in cell

------ Register to get rid of these "In Post" ads! ------


Warning

Warning



Sorry but you need to register for FREE to see the rest of these posts. Please click HERE to register.

We only allow guests to see the first post of every thread to keep valuable resources for our members.






  #9  
Unread 19th April 2010, 01:51
FSt1's Avatar
FSt1
Newsgroup Contributor
 
Posts: n/a
Posts Per Day: 0
My Top Tip Count:
Default Re: Get Month name from Date value in cell

------ Register to get rid of these "In Post" ads! ------


Warning

Warning



Sorry but you need to register for FREE to see the rest of these posts. Please click HERE to register.

We only allow guests to see the first post of every thread to keep valuable resources for our members.






The Code Cage Advertisment
Advertisement
New Reply
The Code Cage at Facebookhe Code Cage at Twitter


Tags
cell, date, month

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

The Code Cage Affilliates



http://www.thecodecage.com/forumz tested by McAfee Security http://www.thecodecage.com/forumz tested by McAfee Security

All times are GMT +1. The time now is 14:32.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Template-Modifications by TMS
No part of this board, functionality or creatives may be copied or reproduced either in part or full without the express permission of The Code Cage Team.
Copyright ©2008 - , Simon lloyd.
We are not associated with nor employed by Microsoft in any way, we simply provide resources!
All MS office icons are registered trademarks of the application they represent and are used with permission from Microsoft
UA-8135493-1
Cultural Forum | Study at Malaysian University