+ Reply to Thread
Results 1 to 9 of 9

Not getting correct output problem

  1. #1
    Forum Contributor
    Join Date
    12-15-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    672

    Not getting correct output problem

    Hi friends,
    I want to concatenate the 3 different columns in column 'g, ac and ad' respectively. I'm not getting the correct output in column 'g' and the concatenate output of column 'ac and ad' respectively. The output of concatenate 'ac and ad' displays in a single column 'g' and the concatenate output of column 'g' is not displaying in column 'g'.

    Please see the following code and suggest me the correction to get correct output.

    Please Login or Register  to view this content.
    Thanking you in anticipation.

    Regards,

    Mukesh
    Last edited by mukeshbaviskar; 02-19-2014 at 03:02 AM.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Not getting correct output problem

    Hi, Mukesh,

    you should take up the tips you get: you only need to check for the row number once.

    You could step through the code all by yourself by setting Stop intoc the code near the beginning or add a break by pressing F9 and see what the code is doing - if you want to concatenate the contents of several cells into one cell which holds contents you should not overwrite but add to the existing contents.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Forum Contributor
    Join Date
    12-15-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    672

    Re: Not getting correct output problem

    Hi Holger,
    Thank you for guidance. I have done the first correction successfully and getting the output of column 'g' in column 'g' but all other 2 outputs are also displaying in column 'g' which should be in column 'ac' and 'ad' respectively.

    I didn't understand the second suggestion of break point using f9. Please explain it little more for me for better understanding. On which line the break point should be place?
    Please Login or Register  to view this content.
    Thank you.

    Have a nice day!

    Regards,

    Mukesh

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Not getting correct output problem

    Hi, Mukesh

    there is a lot of unnecessary movement in the code, and I pretty much doubt that you know what you are putting down as comment should be put down in the code as well:
    Please Login or Register  to view this content.
    I didn't understand the second suggestion of break point using f9. Please explain it little more for me for better understanding. On which line the break point should be place?
    Put the cursor into the first executable line of code and press F9, from my sample this would be the line
    Please Login or Register  to view this content.
    If the code is fired it will hold on that line and you can step through the rest of the code by pressing F8.

    Ciao,
    Holger
    Last edited by HaHoBe; 02-19-2014 at 07:02 AM. Reason: Replaced the original posted F9 (false) with F8 (correct)

  5. #5
    Forum Contributor
    Join Date
    12-15-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    672

    Re: Not getting correct output problem

    Hi Holger,
    Thank you for explanation.

    The code is now working fine for column 'g' and not for columns 'ac' and 'ad'. For columns 'ac' and 'ad' it is taking the value of column 'g' which I don't want.

    In column 'ac' the output should be only concatenate value of columns 'z, aa, ab'

    In column 'ad' the output should be only concatenate value of columns 'aa, ab'

    Today I'm learning a new skill from you with great pleasure.

    Thank you very much for taking trouble to solve my problem.

    Regards,

    Mukesh

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Not getting correct output problem

    Hi, Mukesh,

    you would neeed to add code lines to empty vTemp as that would hold the value form the array before (sorry I missed that as I didnīt look through the code carefully enough):
    Please Login or Register  to view this content.
    Ciao,
    Holger

  7. #7
    Forum Contributor
    Join Date
    12-15-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    672

    Re: Not getting correct output problem

    Hi Holger,
    Excellent! It's working fine as per my requirement.

    Don't say sorry because you are my 'Guru' (teacher). Since long time I'm learning a lot of things from you each time. I always appreciate you for your kind cooperation and patience to teach me.

    Just for curiosity, the output in column 'ac and ad' are the abbreviations hence no need of space in between the output. Is it possible? If so, otherwise leave it. My problem is solved.

    Thank you.

    Regards,

    Mukesh

  8. #8
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Not getting correct output problem

    Hi, Mukesh

    Please Login or Register  to view this content.
    adds a blank after each single cellcontent, you might like to check
    Please Login or Register  to view this content.
    for adding the contents of the cells without a blank.

    patience
    Who? Me being patient? Not at all ...

    Ciao,
    Holger

  9. #9
    Forum Contributor
    Join Date
    12-15-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    672

    Re: Not getting correct output problem

    Hi Holger,
    Thank you very much.

    Regards,

    Mukesh

+ 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] Error in sum formula not correct output
    By mukeshbaviskar in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-31-2014, 11:40 AM
  2. [SOLVED] Not getting correct output value( Label & (i-6) & .Top)
    By annpricks in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-31-2012, 03:44 AM
  3. Find and output correct path
    By 9437excel in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-07-2011, 02:20 PM
  4. problem with CSV output
    By duxis in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-21-2008, 06:16 AM
  5. Month Function Not Displaying Correct Output?
    By NewExcelUser in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-29-2007, 03:50 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