Results 1 to 5 of 5

Select Data with VBA

Threaded View

  1. #1
    Registered User
    Join Date
    01-10-2013
    Location
    Tallahassee
    MS-Off Ver
    Excel 2010
    Posts
    30

    Select Data with VBA

    Could someone please help me with this problem?

    I have data that starts with A6:D6. However, the end point is variable.

    I would like to select all the data except the last row. So if in one instance the used data range is A6: D151, I would like to select A6:D150 (leaving out the last row).

    I have this code but it does not work as I don't know how to move the ActiveCell to the southwest corner of my selection to make the offset work correctly. Currently the ActiveCell is A6 and the offset winds up selecting one row up.


    Selection Code
        Range("A6:D6").Select
        Range(Selection, Selection.End(xlDown)).Offset(rowoffset:=-1).Select
    
    After I select the range correctly, I would like to add make all text there proper case. Someone helped me with that. I am providing this just in case it proves to be useful. Thank you.
    
    For Each Rng In Selection
        Rng.Value = Application.WorksheetFunction.Proper(Rng.Value)
    Next Rng
    I am using Excel 2007.

    --Perry
    Last edited by arlu1201; 02-05-2013 at 11:15 AM.

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