+ Reply to Thread
Results 1 to 10 of 10

Exporting columns into new workbook as text values not formulas

  1. #1
    Registered User
    Join Date
    05-30-2013
    Location
    NY
    MS-Off Ver
    Excel 2003
    Posts
    8

    Exporting columns into new workbook as text values not formulas

    hey, long time reader, first time poster.

    I am trying to export columns filled with formulas such as =NOW() into a new workbook but I want the text value as it appears visually to be pasted over and not the formula.

    Currently, the =NOW() formula is modified in excel using the format cell option to display =NOW() as YYYYMMDD. For example today, I want to paste to =NOW() as text in the new workbook to appear as 20130530 (no cell formatting can be used in the new workbook.

    Below is what I currently have, but want the displayed text copied over and not the formulas/formatting.

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: Exporting columns into new workbook as text values not formulas

    Hi ryanexceln00b,

    change the code to
    Please Login or Register  to view this content.
    for paste values
    Cheers,

    Joshi
    Being with a winner makes you a winner

  3. #3
    Registered User
    Join Date
    11-27-2012
    Location
    Alabama
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: Exporting columns into new workbook as text values not formulas

    You were very close. Try this.

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    05-30-2013
    Location
    NY
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Exporting columns into new workbook as text values not formulas

    Quote Originally Posted by billstpierre79 View Post
    You were very close. Try this.

    Please Login or Register  to view this content.


    Unfortunately, this does not accomplish my goal.

    In my workbook, I have a column with the formula =NOW(). This is formatted to appear visually as "20130530"

    When I amend that code you gave me, the result in the new book displays the value as "41424.487" and not the desired "20130530"

  5. #5
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: Exporting columns into new workbook as text values not formulas

    Try this

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    05-30-2013
    Location
    NY
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Exporting columns into new workbook as text values not formulas

    Close but not there yet.

    While visually it looks fine, it is because the formats of the cells were copied over as well--which I cannot use.

    The solution I need will have the same effect as me copying and pasting the =NOW() column into a Notepad document and the copying and pasting the column from the Notepad document back into excel.

  7. #7
    Registered User
    Join Date
    11-27-2012
    Location
    Alabama
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: Exporting columns into new workbook as text values not formulas

    this might solve your problem
    use this on the cell before you copy and paste
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    05-30-2013
    Location
    NY
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Exporting columns into new workbook as text values not formulas

    Quote Originally Posted by billstpierre79 View Post
    this might solve your problem
    use this on the cell before you copy and paste
    Please Login or Register  to view this content.
    Bill, thank you, this seems promising, but, as my name indicates, I am a n00b at vba.

    In the code below, the two =NOW() columns are Column Y and Column BL. Where would I insert the code that you provided in my below script?


    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    11-27-2012
    Location
    Alabama
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: Exporting columns into new workbook as text values not formulas

    Try

    Please Login or Register  to view this content.
    Last edited by billstpierre79; 05-30-2013 at 03:57 PM. Reason: Code edit

  10. #10
    Registered User
    Join Date
    05-30-2013
    Location
    NY
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Exporting columns into new workbook as text values not formulas

    I found a solution.

    Instead of doing extra programming work in the macro, I fixed the problem from the source file.

    Where I had =NOW() in Column A, I created a Column B with the formula =TEXT(A2, "yyyymmdd") and then used the same vba code above to start at column B instead of A.

    This solved the issue.

    Thank you, i need to tweak it a little bit. but this is great--thanks Bill!
    Last edited by ryanexceln00b; 05-31-2013 at 10:31 AM.

+ 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