+ Reply to Thread
Results 1 to 2 of 2

i am facing problem with range object

  1. #1
    Registered User
    Join Date
    12-27-2011
    Location
    chennai,india
    MS-Off Ver
    Excel 2007
    Posts
    1

    Unhappy i am facing problem with range object

    hello friends,
    i am trying to activate a cell in a "range" so that i can make an entry in three consecutive cells using "offset" property but i am getting an error that says "application defined or object-defined error"
    can anyone tell me what i am doing wrong

    code:
    project = InputBox("enter the project number") 'obtain project number from user
    name = InputBox("enter the customer name") 'obtain customer name from user

    i = 4
    For Each num In Range("number") ' i have defined a range called "number" in "sheet3" of active workbook and the range is from B4 to B33
    'using variable i from 4 to 33 to navigate the range using co-ordinates
    If num.Value = nill Then 'find a nill cell in the range
    Worksheets("sheet3").Range(Cells(i, 2)).Select 'trying to select the range this part gives error
    Exit For 'once found a nill cell exit the for loop
    End If

    i = i + 1
    Next

    ActiveCell.Offset(0, 0).Value = project 'feeding data in the cells using offset property
    ActiveCell.Offset(0, 1).Value = name
    ActiveCell.Offset(0, 2).Value = Now()






    PS: Looking forward to the relevant help.thanks in advance

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: i am facing problem with range object

    Hi and welcome to the board

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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