Results 1 to 5 of 5

Offset Top Left, Bottom Right backwards?

Threaded View

Centexcel Offset Top Left, Bottom Right... 06-01-2013, 02:26 PM
AB33 Re: Offset Top Left, Bottom... 06-01-2013, 02:39 PM
shg Re: Offset Top Left, Bottom... 06-01-2013, 02:41 PM
JS411 Re: Offset Top Left, Bottom... 06-02-2013, 12:36 AM
Centexcel Re: Offset Top Left, Bottom... 06-03-2013, 08:15 AM
  1. #1
    Registered User
    Join Date
    02-20-2013
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2010
    Posts
    52

    Post Offset Top Left, Bottom Right backwards?

    Excel Forum;

    It is my understanding (I am studying a VBA book) that I can set up a range with 2 offset methods, the first selects the top left and the second the bottom right of my desired range. Unfortunately, it seems my understanding of this technique is off. To me, my code appears to select the bottom right first and then the top left of the range. What am I doing wrong?

    My variable nEMP selects my desired range, however, I thought the offset terms would be switched. (I began with .offset(3,1) and .end(xldown) and .end(xltoright) and that didnt work)
    My variable notWorking selects the incorrect range, yet I read it as selecting the headings of the scores. (I would like notWorking to select the nScores range but I want to use the offset method.

    Dim nScores As Integer, nEmp As Integer, i As Integer, notWorking As Integer
    Dim a1 As Range
    
    Set a1 = wsData.Range("a1")
    
    With a1
        nScores = Range(Range("b3"), Range("f3")).Columns.Select
        nEmp = Range(.Offset(20, 5), .Offset(2, .End(xlToRight))).Rows.Select
        notWorking = Range(.Offset(3, 1), .End(xlToRight)).Rows.Select
    End With
    Thank you for your help.
    Attached Files Attached Files

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