LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Concatination error in macro

Hi

In order to select an area limited by the number of rows in column A that
contain data in them I was provided with the following code:

Sub Select_area()

Dim LastRowUsed As Integer
Dim rngToCopy As Range

LastRowUsed = Range("A" & Rows.Count).End(xlUp).Row

Set rngToCopy = "A1:U" & LastRowUsed

End Sub

However, when I run this I get a compelation error: type mismatch and the
debugger highlights the & in the Set rngToCopy instruction which I read as
concatinating the number returned with the U to create a range.

Can anyone explain why this has failed and more importantly how to fix it?

As always thanks for any help
 
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
Conditional Concatination FARAZ QURESHI Excel Discussion (Misc queries) 5 January 23rd 09 01:36 PM
Problem with concatination result. Last digit change to 0 DavCan Excel Worksheet Functions 1 August 24th 07 11:48 PM
How set a format on one of more strings in a concatination Steen Excel Discussion (Misc queries) 6 October 29th 06 04:34 PM
concatination of cell contents archeti Excel Programming 8 November 8th 05 11:10 AM
Excal Concatination of cells that are not empty orourksj Excel Worksheet Functions 5 January 20th 05 09:51 PM


All times are GMT +1. The time now is 05:12 PM.

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

About Us

"It's about Microsoft Excel"