Non-continuous range to column

Packofsnakes

New Member
Joined
May 21, 2021
Messages
3
Office Version
  1. 2016
Platform
  1. Windows
Hello,
Can someone help me with creating a macro which turns a non-continuous range to a column? I have figured out how to select it I just need to copy it to a single column on a different sheet.
Thank you
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Welcome to the Board!

Your question is a bit generic.
Can you please provide us with an actual example of exactly what you want to do?

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
Welcome to the Board!

Your question is a bit generic.
Can you please provide us with an actual example of exactly what you want to do?

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual post

Welcome to the Board!

Your question is a bit generic.
Can you please provide us with an actual example of exactly what you want to do?

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
ok, so I have lists of names like below that I need to combine to a single column on sheet two to track who is working
 

Attachments

  • Screenshot (30).png
    Screenshot (30).png
    85.4 KB · Views: 26
Upvote 0
So, do you just want columns B, I, and P combined in a list, or the related columns too?
Where do you want them combined?
 
Upvote 0
This will write the selected data to column W starting at W1. If you want it to go in a different column change the hardwired 23 to another column number. I suggest working on a copy of your spreadsheet until you're satisfied it works as you would like.

VBA Code:
Sub CopyToColumn()
    For Each c In Selection
        k = k + 1
        Cells(k, 23) = c.Value
    Next
End Sub
 
Upvote 0
So, do you just want columns B, I, and P combined in a list, or the related columns too?
Where do you want them combined?
Just b, I, and P. And I want them copied to column a on sheet 2.
thank you
 
Upvote 0
Give this macro a try...
VBA Code:
Sub NamesColumnBJP()
  With Sheets("Sheet1")
    .Range("B3", .Cells(Rows.Count, "B").End(xlUp)).Copy Sheets("Sheet2").Range("A1")
    .Range("J3", .Cells(Rows.Count, "J").End(xlUp)).Copy Sheets("Sheet2").Cells(Rows.Count, "A").End(xlUp).Offset(1)
    .Range("P3", .Cells(Rows.Count, "P").End(xlUp)).Copy Sheets("Sheet2").Cells(Rows.Count, "A").End(xlUp).Offset(1)
  End With
End Sub
 
Upvote 0
Solution

Forum statistics

Threads
1,223,785
Messages
6,174,539
Members
452,571
Latest member
MarExcelTips

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