• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to copy the bold value and paste in next column continuously until the next bold value find ?

shazzad

New Member
Hi,
I have a file with scattered data. In column A, customer name, product name and sales date are available. And in column B, sales volumes are available.
I need to impose the sumif formula to check the product-wise total sales volume. To do that, I need to get all the products name just beside the sales volume cell.
Since doing that manually is very time consuming (having 4000+rows in total), I need to have all the product name in column C using macro (beside the sales volume). In Column A, the products name are in bold.
Input:

Column A Column B
ABC Customer
Product A
01.01.202210
02.01.202215
03.01.202224
04.01.202223

Expected output
Column AColumn BColumn C
ABC Customer
Product A
01.01.202210Product A
02.01.202215Product A
03.01.202224Product A
04.01.202223Product A

I am trying to above expected result using VBA. Could you please help to have that macro to solve the problem ?
Thanks in advance for your effort.

Shazzad
 
Last edited:
You wrote that I ( shazzad )need to impose the sumif formula to check the product-wise total sales volume.
... then Where do You need those C-column texts?
Why You won't solve Your needs?
... which You seems to skipped as Your expected needed results ... hmm?
What is ... the problem?
 
You wrote that I ( shazzad )need to impose the sumif formula to check the product-wise total sales volume.
... then Where do You need those C-column texts?
Why You won't solve Your needs?
... which You seems to skipped as Your expected needed results ... hmm?
What is ... the problem?

Actually I tried with excel formula but due to scattering in data, it was not working well. Thus i thought thst VBA can solve it. But unfortunately i not so good at VBA. And that’s why posted here with hope to have a solution.
 
In the attached, INPUT sheet has a button at cell E2 which calls the hastily-put-together (edit: apparently useless) macro Macro2.
Completely separately, there's a Power Query solution (a bit different) in the sheet INPUT (2) which queries your data converted to a proper Excel table on the left, and produces the output on the right (cell D20). To update the result on the right, right-click anywhere in the result table and choose Refresh.
A formula approach in sheet INPUT (3) where in cell C4:
Code:
=IF(ISNUMBER(A4),C3,A4)
copied down.
 

Attachments

  • Chandoo50033Sample 0101.xlsm
    39.3 KB · Views: 5
Last edited:
shazzad
As I tried wrote
You need solution for the product-wise total sales volume.
That's different than Your C-column with ( 4000+ rows of data).
... and after that You could do something with ... formulas.
 
In the attached, INPUT sheet has a button at cell E2 which calls the hastily-put-together (edit: apparently useless) macro Macro2.
Completely separately, there's a Power Query solution (a bit different) in the sheet INPUT (2) which queries your data converted to a proper Excel table on the left, and produces the output on the right (cell D20). To update the result on the right, right-click anywhere in the result table and choose Refresh.
A formula approach in sheet INPUT (3) where in cell C4:
Code:
=IF(ISNUMBER(A4),C3,A4)
copied down.
Hi @p45cal, you have made it perfectly... Thanks a lot.
 
Back
Top