+ Reply to Thread
Results 1 to 12 of 12

(Partial Contents of a Cell Output to Another Cell

  1. #1
    Registered User
    Join Date
    07-29-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    15

    (Partial Contents of a Cell Output to Another Cell

    I have this code that outputs the values from c3:c300 to o4 upon right click. Works like a charm:

    Please Login or Register  to view this content.
    But what if I want to output only the first four digits of those cells to o4? The cells only ever contain 14 digit numbers, so how might one accomplish this?
    And can you briefly explain your code, please??

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: (Partial Contents of a Cell Output to Another Cell

    Hello Msimm14,

    You could do it this way.


    Please Login or Register  to view this content.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: (Partial Contents of a Cell Output to Another Cell

    try this:

    Please Login or Register  to view this content.
    the LEFT command just takes the 4 left characters in in the cell

  4. #4
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: (Partial Contents of a Cell Output to Another Cell

    Hello Msimm14,

    I forgot to explain the code.

    Here you go!

    Please Login or Register  to view this content.
    Also see the "Please consider" note at the bottom of this post.

  5. #5
    Registered User
    Join Date
    07-29-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: (Partial Contents of a Cell Output to Another Cell

    Thanks, guys!!
    I can't wait until I get good enough to be able to help you all out.

  6. #6
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: (Partial Contents of a Cell Output to Another Cell

    Hello Msimm14,

    Thank you for the feedback.

    You are welcome, and we are looking forward to you helping us out some day.

    Thank you for adding to my Reputation.

  7. #7
    Registered User
    Join Date
    07-29-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: (Partial Contents of a Cell Output to Another Cell

    Hold the phone!!
    Sorry, but when I enter your code... It returns only one digit and two decimal places... I've formatted the destination cell as "Number", and now only returns one digit.
    Please advise?

  8. #8
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: (Partial Contents of a Cell Output to Another Cell

    Hello Hello Msimm14,

    Oh me goodliness!

    Please send my a sample of your WorkBook Setup. Might be some number format issue.

  9. #9
    Registered User
    Join Date
    07-29-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: (Partial Contents of a Cell Output to Another Cell

    sample.xlsm

    There ya go. The code is sloppy, as I just stripped it down to what you asked for. Also, I changed the input column from c to e...

  10. #10
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: (Partial Contents of a Cell Output to Another Cell

    There ya go. I did not realise you are working with such large numbers, But the attached Workbook should give you a pretty good idea of how to handle situations like that!
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    07-29-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: (Partial Contents of a Cell Output to Another Cell

    ...is there anything you can't do??
    Thanks a Million!!

  12. #12
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: (Partial Contents of a Cell Output to Another Cell

    ...is there anything you can't do??
    Yes, there is a lot more that I cannot do, but with Mentors like Leith Ross, DDL, Jaslake, HaHoBe, arlu2012, FDibbins,shg, snb, JB and all my other supporting Friends on this Forum, I manage to get by, and share with others like your goodself.

+ 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] divide cell based on partial contents of alternate cell
    By LG1 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-03-2013, 05:57 AM
  2. [SOLVED] Look up Partial Cell contents
    By AlexKen in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 09-05-2012, 03:43 PM
  3. Change cell color based upon partial cell contents
    By msmick in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-14-2012, 01:24 AM
  4. Sort by the partial contents of a cell
    By WasWodge in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-24-2011, 03:11 PM
  5. Return cell contents on a partial match
    By rhani111 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-04-2008, 12:13 AM

Tags for this Thread

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