+ Reply to Thread
Results 1 to 14 of 14

Change text to values and adjust column location

  1. #1
    Forum Contributor
    Join Date
    09-21-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    263

    Change text to values and adjust column location

    Hopefully you can help me get this figured out!!

    Please Login or Register  to view this content.
    I am using the same code as above, but changed the columns. If I use the columns above, no issues. If I use the new columns (same data in the columns) Excel freezes up. Error: Excel cannot complete the task with available resources. Keep in mind, that if I run the same code on the same data, there are no issues. I only changed the column from ("GW:GW, JC:JE") to ("D:F"). Been at it for 3 hours, changing things around ect. to no avail!!!!

    My Code:
    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 10-01-2014 at 01:00 AM. Reason: moved to its own thread

  2. #2
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Change text to values and adjust column location

    Try this instead:
    Please Login or Register  to view this content.
    多么想要告诉你 我好喜欢你

  3. #3
    Forum Contributor
    Join Date
    09-21-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    263

    Re: Change text to values and adjust column location

    No good. It freezes Excel. This is really bizarre. The old code worked perfect and still does using the old cell values...but now that I changed the cell values, it does not.

    If it helps, the entire code is below. I would appreciate any help.

    Please Login or Register  to view this content.
    Last edited by Lonney; 10-01-2014 at 09:29 AM.

  4. #4
    Forum Contributor
    Join Date
    09-21-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    263

    Re: Change text to values and adjust column location

    Here is something interesting. If I use the original code with the original cells, it works fine, no issues. But the only change was the range.

    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 10-01-2014 at 10:26 AM. Reason: Added missing CODE tags. Please read and follow the Forum Rules, link above in the menu bar. Thanks.

  5. #5
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Change text to values and adjust column location

    Please post code within
    Please Login or Register  to view this content.
    [/NOPARSE] tags. You can still edit your previous posts to add them in.

    If it is freezing with the code I suggested, most likely because you have too much data and formulas/conditional formatting/etc.

  6. #6
    Forum Contributor
    Join Date
    09-21-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    263

    Re: Change text to values and adjust column location

    Thanks for your help. I placed the code tags in my above post.
    There is no conditional formatting or any other code, other than what is posted above. There are about 10k rows. The issue may be with data which cannot be changed to a number format? For example, there is a miss entry in one cell, which is a string, not a number.

  7. #7
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Change text to values and adjust column location

    Thing is, it's not changing any "format", but to General type, so numbers will be treated as numbers, text as text.

    Try copying your data to a new empty workbook and try the code.

  8. #8
    Forum Contributor
    Join Date
    09-21-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    263

    Re: Change text to values and adjust column location

    Ok. I am at work right now, but will as soon as I get home. With that being said, if I choose other columns; it works fine. Just odd. All I changed from the original code was the column information.

  9. #9
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Change text to values and adjust column location

    A couple of questions, are you using FORMULAS in those columns instead of flat values? The xlConstants reference won't see cells with formulas.

    In my original version I used cDbl() which attempts to extract the numeric values from the text. You can also try replacing the with Val().
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  10. #10
    Forum Contributor
    Join Date
    09-21-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    263

    Re: Change text to values and adjust column location

    Thanks Jerry. No formulas. Nothing changed other than the chosen columns. Instead of pulling in every row from the database; I ran a mysql quarry, only pulling in columns that I needed. I did this to reduce the size of the spreadsheet. Very odd. Your code still works flawlessly, but now on the wrong columns. If I replace with the new columns, Excel crashes.

  11. #11
    Forum Contributor
    Join Date
    09-21-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    263

    Re: Change text to values and adjust column location

    Is it possible, that now that there is less data/columns in the spreadsheet, the code needs to be paused, prior to moving to the formatting code? Basically, if the code is attempting to perform functions on the same set of data/cells at the same time, could this be the issue? I did disable background refresh with the same results. Just a thought. The code works flawlessly when using other columns.

  12. #12
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Change text to values and adjust column location

    You'd have to post a workbook with the macro that is misbehaving. It's all just guessing without it.

  13. #13
    Forum Contributor
    Join Date
    09-21-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    263

    Re: Change text to values and adjust column location

    Good news!! I gave in, created a new workbook - no issues!! The workbook must have been corrupt. Thanks again for all your assistance!!

  14. #14
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Change text to values and adjust column location

    As it appears you've reached a conclusion, I've marked this thread SOLVED for you.
    FYI, this is done through the Thread Tools located above the first post in this thread. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Auto Adjust Stacked Column Need to Adjust Legend
    By tbren in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 03-29-2013, 01:56 PM
  2. Automatically adjust column width to fit text? (Pivot)
    By ThomasCarter in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 03-28-2013, 08:19 AM
  3. [SOLVED] Excel wrapped text column auto adjust
    By oldskool in forum Excel General
    Replies: 1
    Last Post: 01-24-2013, 07:48 AM
  4. How do I change location of figures within a column
    By 1911dan in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-06-2005, 01:06 PM

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