+ Reply to Thread
Results 1 to 3 of 3

Cell refferences in a macro

  1. #1
    Registered User
    Join Date
    12-18-2008
    Location
    Sydney
    MS-Off Ver
    97
    Posts
    10

    Question Cell refferences in a macro

    Hi all,

    I have been trying to use a date range as criteria for a macro to both delete some rows and add data to other rows.

    I have attacked this from many different angles and stressed myself near to insanity, but I think I am very close now, to the solution that is.

    I have a macro to add a sheet and it has two InputBoxes that ask for the start date and the end date, these are then changed to a number so it can be used in another macro.

    Please Login or Register  to view this content.
    Then I Try to refer to these cells, B1 and B2 in another macro.

    Please Login or Register  to view this content.
    This does everything I want except when it inputs the formula into the cell it comes out as

    Please Login or Register  to view this content.
    It would work perfectly if it came out

    Please Login or Register  to view this content.
    The ' either side of the B2 is stopping the macro from being successful, does anyone know how I can get them to stop appearing, or even if there is a better way to do this.

    I am then going to do a simple macro to delete all rows where the word delete appears in row L.

    Thanks
    Brett
    Last edited by BigFish; 01-19-2009 at 08:58 PM.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Brett

    Try changing the code to
    Please Login or Register  to view this content.
    This should get rid of the extra ' in your formula

    rylo

  3. #3
    Registered User
    Join Date
    12-18-2008
    Location
    Sydney
    MS-Off Ver
    97
    Posts
    10

    Talking Got it

    I have changed the code completely and got it to work, simplified it also, I used a macro with a Input box to add the dates onto the same sheet, then use the following code to do what I want.

    Please Login or Register  to view this content.
    Then This to delete them

    Please Login or Register  to view this content.
    And once I have Deleted them I use the same code to add the text I originally needed in L. Sometimes all you need to do is bang your head against a wall long enough and it eventually breaks.

    Thank You for your assistance.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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