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
Code
EP
Side
Qty
Prc
CPrc
UD
NET
HSF
SOD
A
1232
23.2
33.3
U
34
DD12
SOD
B
128
1.4
1.5
D
2
DD12
welij
A
90
2.3
2.6
U
3233
LIWEER
wefw
B
5
2.5
2.9
D
1

<tbody>
</tbody>

Data Summary Sheet
Mes
CurMes
CL
Code
Qty
Prc
EP
Side
Type
NET
Hi
sdf
wef
2we231
5.0
sfd
B
Lo
0
You
swe
sdf
sdf
3
0.78
sd
B
Lo
0
SOD
HSF
1232
23.2
SOD
A
34
SOD
DD12
128
1.4
SOD
B
2

<tbody>
</tbody>

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

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
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,216,105
Messages
6,128,859
Members
449,472
Latest member
ebc9

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