+ Reply to Thread
Results 1 to 4 of 4

Select range of data

  1. #1
    Registered User
    Join Date
    10-25-2016
    Location
    Warsaw,Poland
    MS-Off Ver
    2010
    Posts
    2

    Select range of data

    Hello. I trying to write a vbscript and I don't now why it doesn't work

    I try to select data from C11 to E__ (last cell used in column E). I write a function:

    Function GetPersonalData(objSheet)
    With objSheet
    last = .Cells(.Rows.Count, 5).End(xlUp).Row 'this doesn't work
    Set GetPersonalData = .Range(.Cells(11,3), .Cells(last,5))
    End With
    End Function


    When i write for example last = 23 everything work. I think that I make dump mistake :P
    Can you help me? I write script in vbs filetype
    Last edited by vipx2; 10-25-2016 at 02:59 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,440

    Re: Select range of data

    How are you calling the function?
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor kalbasiatka's Avatar
    Join Date
    02-27-2016
    Location
    Brest, Belarus
    MS-Off Ver
    2021
    Posts
    224

    Re: Select range of data

    Handle breakpoint and see what in variable last
    ps:w Polsce tak samo istnieje forum excel
    To do it for me and help me it is 2 different things!
    Sorry for my english, blame Google translator

  4. #4
    Registered User
    Join Date
    10-25-2016
    Location
    Warsaw,Poland
    MS-Off Ver
    2010
    Posts
    2

    Re: Select range of data

    GetPersonalData(objSheetSrc).Copy

    because I want copy selected range in function GetPersonalData


    kalbasiatka variable last is empty.
    Last edited by vipx2; 10-25-2016 at 03:29 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Select range of data VBA
    By hanif in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-25-2016, 11:40 AM
  2. How can I select data to the end of a range in a macro?
    By warpdesign in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-03-2015, 04:34 PM
  3. Help with Date Range to select data
    By Bobbetski in forum Excel General
    Replies: 1
    Last Post: 10-12-2014, 09:51 PM
  4. Replies: 3
    Last Post: 09-03-2014, 09:59 AM
  5. Replies: 4
    Last Post: 06-17-2013, 05:21 AM
  6. Select a set of data that matchs a range then input said data into a new column SOS
    By joshnathan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-04-2012, 07:46 PM
  7. Select / range data
    By ciprian in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-04-2011, 02:49 AM

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