+ Reply to Thread
Results 1 to 5 of 5

Modification required in the code line which finds the Last column

  1. #1
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Modification required in the code line which finds the Last column

    Dear Friends,

    I get an error message:
    The Error 91 (Object variable not set) appears when executed & debugged in the following line.

    Please Login or Register  to view this content.
    Basically, the above line finds the last used column to execute further. In the workbook, the first column is hidden.

    As my data sheet is already designed, I need to select the columns A:CY only. I don't want to extend the selection further to select the data. But Rows may vary.

    Or, any other reason for the above Error?

    Please help me to modify the code.

    Thanks in advance.

    acsishere.
    Last edited by acsishere; 07-25-2008 at 01:56 PM.

  2. #2
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Smile Dear Friends,

    Any help?

    Thanks in advance,

    acsishere.

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello acsishere,

    The brackets around A3 are the same as =A3. That is you are using the contents of A3. the named argument After must be a cell reference. If you want to start the search after cell A3 then use After:=Range($A$3).

    Sincerely,
    Leith Ross

  4. #4
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Smile Dear Mr. Leith Ross,

    Sir,

    First of all, thanks a lot for your cute code for my earlier thread.
    I tried to modify as you suggested to insert After:=Range($A$3) in the code.

    But shows compilation error.

    Any solution, Please Sir.

    acsishere.
    Last edited by acsishere; 07-25-2008 at 03:52 PM.

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello acsishere,

    Try this...
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

+ 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