+ Reply to Thread
Results 1 to 8 of 8

Excel property needed

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    04-11-2005
    Location
    London
    Posts
    259
    How about something like this?

    Sub defineRange()
        Dim rng As Range
        Dim Y As Integer
        Y = 12 'Or whatever you want it to be.
        Set rng = Range("A1").Resize(Y, 3)
    
        rng.Select 'You should delete this line - I put it in so 
                   'you could see what's happening to your range.
    End Sub
    HTH
    Martin Short

  2. #2
    Registered User
    Join Date
    08-25-2008
    Location
    New Zealand
    Posts
    5
    Hi MartinShort,

    I tryed something like that earlyer, but got an error so thought I did something wrong. I just tryed your code and it gives me the following error

    Run-time error '1004':
    Method 'Range' of object'_Global' failed
    at

    Set rng = Range("A1").Resize(Y, 3)
    I tryed with diffrent Y's cause it might be outofbound.

    What I tryed earlyer was something like worksheet.range("a1:f4").resize or so

    Thank you, John

  3. #3
    Forum Contributor
    Join Date
    04-11-2005
    Location
    London
    Posts
    259
    Hi John

    A bit confused. I tried the code out (just to check if I'd done something stupid). It does work on my PC.

    Can you post an example worksheet please and I'll see if I can help.

    Martin

+ 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. help with 32nd rounding
    By novice2430 in forum Excel General
    Replies: 12
    Last Post: 06-29-2008, 05:44 PM
  2. shifting online data comes to excel as per formula with very minimum timelag
    By cramatr in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-04-2007, 10:08 PM
  3. Excel 2003 Not Excelling in Handling 2000 .xls File
    By pands in forum Excel General
    Replies: 4
    Last Post: 02-27-2007, 05:56 PM
  4. Excel Macro help needed!
    By charles_head in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-13-2006, 06:17 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