Trying to UNION same cell and blank cells. Is this possible?

pawest

Board Regular
Joined
Jun 27, 2011
Messages
105
Hello,

I'm trying to select the same cell and a blank cell multiple with a UNION(). Is this possible?

Here's a summary of my code:
Code:
Dim c
Dim Rng As Range
Dim blankC As Range

Set blankC = Range("XFD1048576")

Set Rng = Union(Cells(c.Row, 1), Cells(c.Row, 4), Cells(c.Row, 2), _
                        Cells(c.Row, 3), Cells(c.Row, 5), blankC, blankC, Cells(c.Row, 11), Cells(c.Row, 6), _
                        Cells(c.Row, 8), Cells(c.Row, 7), Cells(c.Row, 13), blankC, blankC, blankC, blankC, _
                        Cells(c.Row, 10), Cells(c.Row, 13), blankC, blankC, blankC, blankC, blankC, blankC, _
                        Cells(c.Row, 14), Cells(c.Row, 15), blankC, blankC, blankC, blankC, blankC, blankC, blankC, _
                        Cells(c.Row, 22))

Ultimately, I'm trying to copy various cells and reorganize them including blank cells to conveniently use UNION for a quick copy and paste as opposed to explicitly defining where to paste everything.

Any suggestions? Thanks!
 
Last edited:
Rick,
Here's what my sheets look like:

Data Sheet
[TABLE="width: 500"]
<tbody>[TR]
[TD]Code
[/TD]
[TD]EP
[/TD]
[TD]Side
[/TD]
[TD]Qty
[/TD]
[TD]Prc
[/TD]
[TD]CPrc
[/TD]
[TD]UD
[/TD]
[TD]NET
[/TD]
[/TR]
[TR]
[TD]HSF
[/TD]
[TD]SOD
[/TD]
[TD]A
[/TD]
[TD]1232
[/TD]
[TD]23.2
[/TD]
[TD]33.3
[/TD]
[TD]U
[/TD]
[TD]34
[/TD]
[/TR]
[TR]
[TD]DD12
[/TD]
[TD]SOD
[/TD]
[TD]B
[/TD]
[TD]128
[/TD]
[TD]1.4
[/TD]
[TD]1.5
[/TD]
[TD]D
[/TD]
[TD]2
[/TD]
[/TR]
[TR]
[TD]DD12
[/TD]
[TD]welij
[/TD]
[TD]A
[/TD]
[TD]90
[/TD]
[TD]2.3
[/TD]
[TD]2.6
[/TD]
[TD]U
[/TD]
[TD]3233
[/TD]
[/TR]
[TR]
[TD]LIWEER
[/TD]
[TD]wefw
[/TD]
[TD]B
[/TD]
[TD]5
[/TD]
[TD]2.5
[/TD]
[TD]2.9
[/TD]
[TD]D
[/TD]
[TD]1
[/TD]
[/TR]
</tbody>[/TABLE]

Data Summary Sheet
[TABLE="width: 500"]
<tbody>[TR]
[TD]Mes
[/TD]
[TD]CurMes
[/TD]
[TD]CL
[/TD]
[TD]Code
[/TD]
[TD]Qty
[/TD]
[TD]Prc
[/TD]
[TD]EP
[/TD]
[TD]Side
[/TD]
[TD]Type
[/TD]
[TD]NET
[/TD]
[/TR]
[TR]
[TD]Hi
[/TD]
[TD]sdf
[/TD]
[TD]wef
[/TD]
[TD]2we[/TD]
[TD]231
[/TD]
[TD]5.0
[/TD]
[TD]sfd
[/TD]
[TD]B
[/TD]
[TD]Lo
[/TD]
[TD]0
[/TD]
[/TR]
[TR]
[TD]You
[/TD]
[TD]swe
[/TD]
[TD]sdf
[/TD]
[TD]sdf
[/TD]
[TD]3
[/TD]
[TD]0.78
[/TD]
[TD]sd
[/TD]
[TD]B
[/TD]
[TD]Lo
[/TD]
[TD]0
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]SOD
[/TD]
[TD][/TD]
[TD]HSF
[/TD]
[TD]1232
[/TD]
[TD]23.2
[/TD]
[TD]SOD
[/TD]
[TD]A
[/TD]
[TD][/TD]
[TD]34
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]SOD
[/TD]
[TD][/TD]
[TD]DD12
[/TD]
[TD]128
[/TD]
[TD]1.4
[/TD]
[TD]SOD
[/TD]
[TD]B
[/TD]
[TD][/TD]
[TD]2
[/TD]
[/TR]
</tbody>[/TABLE]

I'm trying to copy specific parts of the Data Sheet table that are "SOD" under "EP" and add that data to the Data Summary sheet. As you can see there are blanks and SOD is repeated twice. Additionally, I would like to add it to the Data Summary after the last row in the data set... so a lastRow + 1 type of deal to paste/move to.

There's a lot of data and I would prefer not to copy and paste by choosing cells explicitly.

I hope that helps. Thanks for your continued help.
 
Upvote 0

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Rick,
Here's what my sheets look like:
I'm trying to copy specific parts of the Data Sheet table that are "SOD" under "EP" and add that data to the Data Summary sheet. As you can see there are blanks and SOD is repeated twice. Additionally, I would like to add it to the Data Summary after the last row in the data set... so a lastRow + 1 type of deal to paste/move to.
More important to a program is the actual Column letters or numbers as opposed to the text you used for your header row... can you tell me the column letters or numbers for both the data sheet and the summary sheet so I will know what columns map into what columns?
 
Upvote 0
Column numbers for Data sheet: 1 to 8; A to H

Column numbers for Data Summary sheet: 1 to 10; A to J
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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