Selecting A Range of Cells that is Different Sizes

LuckCalibration

New Member
Joined
Jan 11, 2017
Messages
2
pi68mBY.png

Hello I have a Worksheet with Data that is Different sizes as you can see i have many ranges that have Names Trades and Hours aswell as Date
i am trying to make a macro that would select this range regardless of whether it is 14 cells or 5 and then add to the selection the two adjacent cells in the column to the right and then the cells in the row above it below is the vba i do currently have

What i really want to do is make a macro to select these ranges and copy them to the first 3 colums going down in chronological order

Code:
Sub SelectNameColumn()
Range(ActiveCell, ActiveCell.End(xlDown)).Select
End Sub
 

Some videos you may like

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Jerry Sullivan

MrExcel MVP
Joined
Mar 18, 2010
Messages
8,787
Welcome to MrExcel,

From your description, I think I understand the blocks of cells you want to select. I'm not sure I understand where you want them to be copied.

Are you wanting to copy them to columns A:C of a new sheet, with the blocks in order of oldest new newest date?
 

LuckCalibration

New Member
Joined
Jan 11, 2017
Messages
2
Welcome to MrExcel,

From your description, I think I understand the blocks of cells you want to select. I'm not sure I understand where you want them to be copied.

Are you wanting to copy them to columns A:C of a new sheet, with the blocks in order of oldest new newest date?
yes i want to cop them to columns A:C of a new sheet in order of oldest to newest.
 

Jerry Sullivan

MrExcel MVP
Joined
Mar 18, 2010
Messages
8,787
Sorry that I lost track of this as an unanswered response.

Can the code assume these patterns that are true of your screenshot example:

1. The blocks of data are aligned so that the rows with dates (rows 1 and 16 in your example) have only dates (and no employee data for another block of data).

2. The data blocks are all 3 columns wide, they are aligned, and there are no blank columns in between data blocks.

If you are going to use this new sheet of consolidated data for analysis, I'd suggest you "normalize" the data, by moving the dates to a 4th field in the new sheet and listing the date for each record (not just once per day). This allows you to easily sort, query or pivot the data. Would you like to try that approach?
 

Watch MrExcel Video

Forum statistics

Threads
1,122,656
Messages
5,597,390
Members
414,141
Latest member
Joey_T92

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
Top