Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Colin Vicary
 
Posts: n/a
Default Selecting Non-Consecutive Variables


Hello Experts!

I've written some code that prompts the user to indicate which column
two type of data appear in.

I then want to select those two columns, which may not be next to each
other, to copy to another sheet.

I've tried both versions below but neither work! Can anyone tell me
where I'm going wrong?

Columns(ISBNCol & "," & QtyCol).Select
Columns(ISBNCol, QtyCol).Select

Thanks

Colin


--
Colin Vicary
------------------------------------------------------------------------
Colin Vicary's Profile: http://www.excelforum.com/member.php...o&userid=10472
View this thread: http://www.excelforum.com/showthread...hreadid=507283

  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Selecting Non-Consecutive Variables

Union(Columns(ISBNCol), Columns(QtyCol)).Select

But you don't usually have to select a range to work with it.


Colin Vicary wrote:

Hello Experts!

I've written some code that prompts the user to indicate which column
two type of data appear in.

I then want to select those two columns, which may not be next to each
other, to copy to another sheet.

I've tried both versions below but neither work! Can anyone tell me
where I'm going wrong?

Columns(ISBNCol & "," & QtyCol).Select
Columns(ISBNCol, QtyCol).Select

Thanks

Colin

--
Colin Vicary
------------------------------------------------------------------------
Colin Vicary's Profile: http://www.excelforum.com/member.php...o&userid=10472
View this thread: http://www.excelforum.com/showthread...hreadid=507283


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
Bernie Deitrick
 
Posts: n/a
Default Selecting Non-Consecutive Variables

Colin,

It depends on what ISBNCol and QtyCol a numbers, ranges, strings?

If numbers (3, 5, for example) or strings ("C", "E", for example):

Union(Columns(ISBNCol), Columns(QtyCol)).Select

If ranges:

Union(ISBNCol.EntireColumn, QtyCol.EntireColumn).Select

HTH,
Bernie
MS Excel MVP


"Colin Vicary" wrote in message
news:Colin.Vicary.22k66y_1138810501.1725@excelforu m-nospam.com...

Hello Experts!

I've written some code that prompts the user to indicate which column
two type of data appear in.

I then want to select those two columns, which may not be next to each
other, to copy to another sheet.

I've tried both versions below but neither work! Can anyone tell me
where I'm going wrong?

Columns(ISBNCol & "," & QtyCol).Select
Columns(ISBNCol, QtyCol).Select

Thanks

Colin


--
Colin Vicary
------------------------------------------------------------------------
Colin Vicary's Profile: http://www.excelforum.com/member.php...o&userid=10472
View this thread: http://www.excelforum.com/showthread...hreadid=507283



  #4   Report Post  
Posted to microsoft.public.excel.misc
Colin Vicary
 
Posts: n/a
Default Selecting Non-Consecutive Variables


Genius!

Thank you, worked perfectly.

Colin


--
Colin Vicary
------------------------------------------------------------------------
Colin Vicary's Profile: http://www.excelforum.com/member.php...o&userid=10472
View this thread: http://www.excelforum.com/showthread...hreadid=507283

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
counting consecutive absences jerry37917 Excel Worksheet Functions 6 October 9th 07 09:22 PM
Count Intervals of 2 Consecutive Values in same Row and Return Count across Row Sam via OfficeKB.com Excel Worksheet Functions 6 November 29th 05 03:27 PM
adding three consecutive columns Darin Gibson Excel Worksheet Functions 1 November 22nd 05 08:50 PM
Passing Variables Jeff Excel Discussion (Misc queries) 1 November 4th 05 06:46 PM
Return Consecutive Values - Pairs Sam via OfficeKB.com Excel Worksheet Functions 6 July 2nd 05 04:43 PM


All times are GMT +1. The time now is 06:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"