+ Reply to Thread
Results 1 to 6 of 6

Remove unnecessary code in macro

  1. #1
    Registered User
    Join Date
    03-17-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    13

    Remove unnecessary code in macro

    Hi
    I'll start by saying I'm very new to all this and I'm learning a lots as I go.

    I have multiple lots of data that is in two columns. The left with a timestamp that I need to convert to an excel format and the other just values relevant to the timestamp.

    My macro was developed with help here
    http://www.excelforum.com/excel-prog...-relative.html

    It converts both columns to a date format. I'd like only the column that contains dates to do so.

    Please Login or Register  to view this content.
    I think I have fixed it though probably not in the most elegant of ways.
    I modified the macro slightly and I thinks its much better now copying and putting the excel dates back on top of the original timestamps and fixing the value column. I'm not sure its the simplest and neatest it could be and I was wondering if there is any irrelevant code I could remove. Am I correct in saying the blue bit can go?
    Please Login or Register  to view this content.
    cheers rileyp
    Last edited by rileyp; 04-03-2013 at 03:42 AM.

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: tidy up perhaps?

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title.
    Last edited by arlu1201; 03-28-2013 at 12:22 PM.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    03-17-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Remove unecessary code in macro

    Thanks Fotis1991 I have edited my post.

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Remove unnecessary code in macro

    Thanks for that. I believe that soon one of our members(as my VBA skills are not good) will be able to help you.

  5. #5
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Remove unnecessary code in macro

    Yes the blue highlighted section can go.

    Also, why are you using activecell? Will you be highlighting / selecting a cell and then running the macro?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  6. #6
    Registered User
    Join Date
    03-17-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Remove unnecessary code in macro

    I am using active cell as that is what was suggested to me in my other post I linked to above. I suppose if the macro was smart enough it could probably search the whole spreadsheet for strings that look like this 2012-07-19T23:00:01.01+10 and then convert them into an excel date time . My original post is here http://www.excelforum.com/excel-gene...date-time.html
    I have no idea how that would be done though.
    cheers rileyp
    Last edited by rileyp; 04-03-2013 at 11:59 PM.

+ 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