Need help with an Excel Macro

Copper Contributor

Hello,

 

I am new to creating Macros and would like to know if there is a way to write a macro to do the following.

I would type information into two columns in Excel as follows:

 

Qty

Label

1

Apples

2

Bananas

4

Carrots

 

I would then run a macro to change these two columns to create a column like this:

Apples

Bananas

Bananas

Carrots

Carrots

Carrots

Carrots

 

Is this possible by using a macro?  Thank you.

1 Reply

Hi,

 

The best way is to use Get & Transform (aka Power Query) to do that as follows:

Power Query.png

 

Please find the attached file to see the solution.

 

Try to change the Qty number, then go to:

Fruits Table >> Right-click >> Refresh

and see how it's updated.

 

Hope that helps

 

@FarukAhmed