Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Parsing Variable string

see my response to yuor other thread: Saving the revised date for any
workbook.

"Still_learning" wrote in message
...
Just a Question for you lets say I apply this €“ BeforeSave event to
VBAProject (PERSONAL.XLS). Would this event still be triggered before a
save
to all other workbook? If not is there a way to have a Global BeforeSave
event for all workbook?

"Rick Rothstein" wrote:

The workbook has a BeforeSave event that is triggered before a save
operation takes place... you can put code in there to be executed before
the
save happens. To get to this procedure area easily, right click the XL
icon
immediately to the left of the File item on Excel's menu bar and select
View
Code from the popup menu that appears. This will take you to the code
window
for the workbook... click the drop down on the left side at the top of
the
code window and select Workbook from the list, then click the drop down
on
the right and click on BeforeSave in its list. You will be presented with
the event handler for the BeforeSave event... your code would go there.

--
Rick (MVP - Excel)


"Still_Learning" wrote in
message
...
Thank you, Rick
This solved my parsing problem.
I changed revisedDate to be a date instead of a string.
What I was doing with revisedDate was placing it in a footer so when
any
one
click on the button - Macro it would place a uniform footer across all
paper
work.

The only thing Im working on now is making it update the revised date
in
the footer any time some save changed data.
Do you know of a way to set something up (maybe a private sub or
function
or
something else) that would active when someone save excel with changes.


"Rick Rothstein" wrote:

I'm not entirely clear on the structure of your code, but I think you
want
the Format for what you want to do. For example,

DateOnly = Format(CDate(RevisedDate), "m/dd/yyyy")

I'm not sure why you are storing your date/time values in a String
variable
though. If you used a Date variable, you wouldn't need the CDate call
(note
the # signs instead of the quote marks)...

Dim RevisedDate As Date
RevisedDate = #7/22/2009 3:19:52 PM#
DateOnly = Format(RevisedDate, "m/dd/yyyy")

--
Rick (MVP - Excel)


"Still_Learning" wrote in
message
...
Hi,
I'm need to keep the first part of my variable and place the return
value
back to the save variable.

Dim RevisedDate as String
RevisedDate = "7/22/2009 3:19:52 PM"

Now i need to parse this to have.
RevisedDate = "7/22/2009"
I need help on the parseing part.

Thanks




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
Parsing a string [email protected] Excel Programming 10 November 21st 08 05:49 PM
parsing a string BorisS Excel Programming 0 April 23rd 07 02:14 AM
Parsing a string neverends Excel Programming 2 June 7th 06 05:38 PM
String parsing with variable lenght strings frosterrj Excel Worksheet Functions 10 March 31st 06 11:46 PM
parsing a string Mark[_57_] Excel Programming 4 April 28th 05 04:42 PM


All times are GMT +1. The time now is 08:00 AM.

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"