Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8258461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:32:36+00:00 2026-06-08T02:32:36+00:00

In my excel file, there are hundred columns. I want to convert some columns

  • 0

In my excel file, there are hundred columns. I want to convert some columns (eg. Column A, C,F, G..) from text to date. It really take time if manually change each column one column by one.
How can I do it ? By using VBA ?

The original text column format just like ’31-Dec-2011 00:00:00′. I want to convert to ‘dd/mm/yyyy’ 31/12/2011

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T02:32:39+00:00Added an answer on June 8, 2026 at 2:32 am

    If you actually want to chop the time off in each of the cells then this might be an approach:

    If the target times are in column A of a sheet called “target” and the column header in A1 is “StartTime”

    You could amend the below and add an argument so that it takes the column address. Then it could be called several times to carry out this operation on several columns.

    Sub ChopOffTime()
    
    dim mySheetName as string
    mysheetname = "target" '<<<<change to your sheet name
    
    myLstRow = Excel.ActiveWorkbook.Sheets(mysheetname ).Cells(Excel.ActiveWorkbook.Sheets(mysheetname ).Rows.Count, Excel.ActiveWorkbook.Sheets(mysheetname).Range("A2").Column).End(Excel.xlUp).Row
    With Excel.ActiveWorkbook.Sheets(mysheetname)
    
                .Columns("B:B").Insert Excel.xlToRight
                .Range("B2:B" & myLstRow).FormulaR1C1 = "=TIME(HOUR(RC[-1]),MINUTE(RC[-1]), SECOND(RC[-1]))"
                .Range("B1") = "StartTime" '<<<<<change to appropriate header
                .Columns("B:B").Copy
                .Columns("A:A").PasteSpecial Excel.xlPasteValues
                .Columns("B:B").Delete Excel.xlToLeft
    
    End With
    
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There's this Excel file I want users to be able to download from my
I have a fairly large Excel file. In this file there is a column
I have a few hundred Excel files, where each file has some data on
I have an excel file in which there are 10 columns with the data
Is there any way to create a new Excel file from command line?
I have a text file exported out of a Excel document. Along its columns
Here users browse to the Excel file from there system and then data is
Imagine an Excel file with 2 columns like below: Name Surname John Some surname
Is there any method to use to save data from webpage to excel file
Is there a gem in Ruby which can write to an Excel file, with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.