Formula or VBA to align multiple cells with same value under one column

RoanRSA

New Member
Joined
Nov 3, 2020
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Hi,I am a novice at excel and would appreciate any help I can get.

I would like to know is there a function/formula/VBA that one can use to align multiple cells with the same value across a worksheet into a specific column for for example:

I want to align all the cells highlighted in red with the value 3026 (Specific code) under column CH by inserting blank cells in front of 3026. It is very important that the 3026 values stay in its original row. Is there any other way of doing this without manually having to insert blank cells row by row so that all the 3026 values line up under column CH?
Excel Query.jpg
 
Hi Joe4, in an effort to understand the VBA code you used here, would you be able to give a small tutorial explaining what steps to did to record or code this Macro? I have a real world task that involves the exact same issue as RoanRSA, but I would like understand what the Macro is doing at each step of the code.
Thanks in advance.
 
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Hi Joe4, in an effort to understand the VBA code you used here, would you be able to give a small tutorial explaining what steps to did to record or code this Macro? I have a real world task that involves the exact same issue as RoanRSA, but I would like understand what the Macro is doing at each step of the code.
Thanks in advance.
Welcome to the Board!

Loops cannot be recorded, so very little of the code I posted would the Macro Recorder help with. The original code that I posted has got comments in it, explaining what I did each step of the way. And in post 10, I explain some of the logic in more detail.

If you have other questions about specific parts of my code, please feel free to post them here.
 
Upvote 0

Forum statistics

Threads
1,214,784
Messages
6,121,535
Members
449,037
Latest member
tmmotairi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top