Closed Thread
Results 1 to 2 of 2

variable range

  1. #1
    Registered User
    Join Date
    03-21-2012
    Location
    waterford
    MS-Off Ver
    Excel 2003
    Posts
    5

    variable range

    Hi all
    I am trying to write code to select a range of cells, copy and paste to sheet2
    In my sheet i have a button that adds a line copying the format of the cells above
    i need to be able to select all the text in column A down as far as the add Line button but not including the is cell
    I have the code to select all as seen below. How can i select all the text from A3 to the cell just above the cell named "LastCell"

    Sub Copy()
    Dim LastCell As Integer

    ' name the cell as lastcell that you wish to find

    Range("A3", Range("LastCell")).Select
    Selection.Copy
    Range("C2").Select
    Selection.PasteSpecial

    End Sub

    Thanks

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: variable range

    Welcome to the Forum, unfortunately:

    This is a duplicate post and as such does not comply with Rule 5 of our forum rules. This thread will now be closed, you may continue in your other thread.

    Thread Closed.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

Closed Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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