Results 1 to 7 of 7

Select Range using variables

Threaded View

  1. #1
    Registered User
    Join Date
    11-29-2009
    Location
    dubai
    MS-Off Ver
    Excel 2003
    Posts
    56

    Select Range using variables

    Hi,

    I have set variables to identify the first row, last row, and last column. when I try to select the range it gives me an error.


    Sub SortData()
    'Dim RowTitle As Integer
    'Dim LastRow As Integer
    Dim LastCol As String
    
    
    RowTitle = ActiveSheet.Range("A1")
    LastRow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Offset(1, 1).Row
    LastCol = ActiveSheet.Cells(RowTitle, Columns.Count).End(xlToLeft).Offset(1, 0).Column
    
    
    Range((ActiveSheet.Cells(RowTitle, 1)), (ActiveSheet.Cells(LastRow, LastCol))).Select
    End Sub
    Thanks
    R
    Last edited by rvc81; 12-08-2010 at 08:05 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1