Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying Multiple Selections

Status
Not open for further replies.

Mizzness

Programmer
May 2, 2003
174
US
Hello All.

I'm trying to copy multiple selections.
However I get the error message stating "That command cannot be used on multiple elections".
I'm simply holding down the CTRL key & highlighting what I need to copy.

I obviously need to chk or uncheck something but cannot find it & MS Help is helpless.

Has anyone else experienced this ? and can you tell me to solve this ?

Thanx.
 
Hi there,

You can't do that, Excel will not allow it. No non-contiguous ranges; the object model is not designed to handle it.

Is there something you really need this for? If so, please explain, in detail, what it is you need to copy and where it needs to go. There may be a possibility of performing a workaround via VBA code.

-----------
Regards,
Zack Barresse
 
Zack,

What I'm doing is copying cells A1:F1, A5:F5, A9:F9 and so on. It is every fourth row & I'm pasting this into a new workbook.

Since the recorder would be useless, can you guide me as I could not find any fact on this website either.

Thanx.
 
What are you trying to do here exactly? Will this be a repetative action? Where will the data be going? Will you be pasting the blank rows as well or condensed data? Will the data grow? How far down would you like to copy (every 4 rows)? What sheet are you copying from/going to? Same workbook everytime?

-----------
Regards,
Zack Barresse
 
Hi Peter,

Nice link. :) I still use your V/HLOOKUPNTH quite a bit. 8)

-----------
Regards,
Zack Barresse
 
Hi Firefyter,

Thanks!

Pleased you find V/HLOOKUPNTH useful as I do. I have made one change to increase its usefulness which you may not have seen:

Code:
Function VLOOKUPNTH(lookup_value, table_array As Range, _
           col_index_num As Integer, nth_value)
' Extension to VLOOKUP function.  Allows for finding
' the "nth" item that matches the lookup value.
' 2/1/05 - Modified to handle Wildcards - "=" changed to "like"

Dim nRow As Long
Dim nVal As Integer
Dim bFound As Boolean
  VLOOKUPNTH = "Not Found"
  With table_array
    For nRow = 1 To .Rows.Count
      If .Cells(nRow, 1).Value Like lookup_value Then
      'If .Cells(nRow, 1).Value = lookup_value Then
        nVal = nVal + 1
      End If
      If nVal = nth_value Then
        VLOOKUPNTH = .Cells(nRow, col_index_num).Text
        Exit Function
      End If
    Next nRow
  End With
End Function

Good Luck!

Peter Moran
 
Peter,

Thanx for the link !
It's quite useful.

Firefyter:
In short, the data I receive will always be copied into a blank workbook. This is done once on a monthly basis.
I will be copying & pasting data not blank rows.

Thanx again.
 
Did you try the link Peter linked? Can you adapt it or are you looking for something different?

-----------
Regards,
Zack Barresse
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top