+ Reply to Thread
Results 1 to 5 of 5

error message, probaly by not defining things :/

  1. #1
    Registered User
    Join Date
    02-11-2017
    Location
    Manchester, england
    MS-Off Ver
    2010
    Posts
    6

    Question error message, probaly by not defining things :/

    hi,

    i have this code for converting a webpge into an excel document, then i can apply a bunch of autofilters on the copied data to manipulate it...i am fairly new to VBA, but using this project as a way to learn it...

    i have an issue with warning messages....the one at the moment is with when i am defining last row.....originally there was one lastrow dimension, but created 2, 1 for each sheet, as that was giving me an error. that error then dissappeared and replaced it with

    "object variable or with block variable not set"

    i have 2 sheets, both named objects as SI and TR, SI is where the raw webpage goes to to get converted, then i extract the filtered data, paste it into the sheet TR which is the cover, and will e used by people....code is as follows:


    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    11-18-2014
    Location
    australia
    MS-Off Ver
    2015
    Posts
    43

    Re: error message, probaly by not defining things :/

    what's SI and TR? (worksheets, right? they aren't defined anywhere, at least in the code you've shown)

    Dim SI as Worksheet, TR as Worksheet
    Set SI = Sheets("sheetname")
    Set TR = Sheets("sheetname")
    Last edited by ferday; 03-23-2017 at 08:27 PM.

  3. #3
    Registered User
    Join Date
    02-11-2017
    Location
    Manchester, england
    MS-Off Ver
    2010
    Posts
    6

    Re: error message, probaly by not defining things :/

    Thanks for your reply!!

    The worksheets are named (in object properties, in the first row you can change the object name to refer to it in code. i got this when looking at someone elses code for something really complex)

    When I follow your advise ferday, it errors the "Dim SI as Worksheet". it says duplicate declaration in current scope

    Attached is how I named the sheets

    SI named.png
    Attached Images Attached Images
    Last edited by Ammers93; 03-24-2017 at 02:22 PM. Reason: wrong file uploaded

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: error message, probaly by not defining things :/

    Hi there Ammers93

    Adding images does not help unfortunately...Text not readable. Preferably either enter the entire Code or upload a sample worksheet. This will increase our chance of success.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  5. #5
    Registered User
    Join Date
    02-11-2017
    Location
    Manchester, england
    MS-Off Ver
    2010
    Posts
    6

    Re: error message, probaly by not defining things :/

    right, sorry, i am new to forums....

    I have attached the sample sheet......if you could kindly have a look and tell me where i have gone wrong
    Attached Files Attached Files

+ 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. Defining Footer and Header With more than 1 line ERROR
    By brainzlp in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-31-2015, 02:41 PM
  2. [SOLVED] Error Checking Macro to cycle through rows looking at specific columns for things
    By Hyflex in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-21-2015, 08:36 PM
  3. An error message on open - a totally blank VBA message box
    By Mr_Tigas in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-05-2013, 11:29 AM
  4. Defining Array - Runtime error 9, Subscript out of range error
    By MaartenW in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-03-2012, 07:32 AM
  5. replace VBA run-time error message with custom message
    By BEEJAY in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-14-2006, 11:05 AM
  6. Need help resolving error in defining last row
    By clmarquez in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-20-2005, 02:44 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