Resend my activation email : Register : Log in 
BCF: Bike Chat Forums


Macro type thing help

Reply to topic
Bike Chat Forums Index -> The Geek Zone
View previous topic : View next topic  
Author Message

chris-red
Have you considered a TDM?



Joined: 21 Sep 2005
Karma :

PostPosted: 17:14 - 31 Aug 2010    Post subject: Macro type thing help Reply with quote

Following on from this thread

https://www.bikechatforums.com/viewtopic.php?t=203649&highlight=macro


I need to create a macro or something that will convert a column of dates into a different format

I tried to do it in Excel (see the thread) but it kept dropping leading 0's.

So have given up on Excel, are there other ways?

Ideally I'd copy and paste a column of dates press a button and get the same column of dates with the translated date next to it.


The date change is from 31/08/2010 - 1100831


DD/MM/YYYY to YYYMMDD

2010 becomes 110
1999 becomes 099
2110 becomes 210

etc. etc.

Anyone have any ideas?
____________________
Well, you know what they say. If you want to save the world, you have to push a few old ladies down the stairs.
Skudd:- Perhaps she just thinks you are a window licker and is being nice just in case she becomes another Jill Dando.
WANTED:- Fujinon (Fuji) M42 (Screw on) lenses, let me know if you have anything.
 Back to top
View user's profile Send private message You must be logged in to rate posts

The Shaggy D.A.
Super Spammer



Joined: 12 Sep 2008
Karma :

PostPosted: 17:47 - 31 Aug 2010    Post subject: Reply with quote

Missed the other thread, but aren't you just subtracting 1900 from the year? You could just have a cell next to the date that slices it, formats it, then concatenates the fields back together in the order you want :-

=CONCATENATE(TEXT((YEAR(A1)-1900),"000"),TEXT(MONTH(A1),"00"),TEXT(DAY(A1),"00"))

Where A1 is the cell with the date in it.
____________________
Chances are quite high you are not in my Monkeysphere, and I don't care about you. Don't take it personally.
Currently : Royal Enfield 350 Meteor
Previously : CB100N > CB250RS > XJ900F > GT550 > GPZ750R/1000RX > AJS M16 > R100RT > Bullet 500 > CB500 > LS650P > Bullet Electra X & YBR125 > Bullet 350 "Superstar" & YBR125 Custom > Royal Enfield Classic 500 Despatch Limited Edition (28 of 200) & CB Two-Fifty Nighthawk > ER5
 Back to top
View user's profile Send private message You must be logged in to rate posts

chris-red
Have you considered a TDM?



Joined: 21 Sep 2005
Karma :

PostPosted: 19:05 - 31 Aug 2010    Post subject: Reply with quote

The Shaggy D.A. wrote:
Missed the other thread, but aren't you just subtracting 1900 from the year? You could just have a cell next to the date that slices it, formats it, then concatenates the fields back together in the order you want :-

=CONCATENATE(TEXT((YEAR(A1)-1900),"000"),TEXT(MONTH(A1),"00"),TEXT(DAY(A1),"00"))

Where A1 is the cell with the date in it.





Love you Mr. Green
____________________
Well, you know what they say. If you want to save the world, you have to push a few old ladies down the stairs.
Skudd:- Perhaps she just thinks you are a window licker and is being nice just in case she becomes another Jill Dando.
WANTED:- Fujinon (Fuji) M42 (Screw on) lenses, let me know if you have anything.
 Back to top
View user's profile Send private message You must be logged in to rate posts

Frost
World Chat Champion



Joined: 26 May 2004
Karma :

PostPosted: 19:07 - 31 Aug 2010    Post subject: Reply with quote

If you want anything fancier, use VBA. There will be a bit of overhead learning it, but if your in the habit of doing things like this it's going to be worth it.
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts
Old Thread Alert!

The last post was made 16 years, 38 days ago. Instead of replying here, would creating a new thread be more useful?
  Display posts from previous:   
This page may contain affiliate links, which means we may earn a small commission if a visitor clicks through and makes a purchase. By clicking on an affiliate link, you accept that third-party cookies will be set.

Post new topic   Reply to topic    Bike Chat Forums Index -> The Geek Zone All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Read the Terms of Use! - Powered by phpBB © phpBB Group
 

Debug Mode: ON - Server: birks (www) - Page Generation Time: 0.07 Sec - Server Load: 0.42 - MySQL Queries: 13 - Page Size: 40.88 Kb