+ Reply to Thread
Results 1 to 4 of 4

Macro causes a cell with a vlookup to delete vlookup and replace with a named cell

  1. #1
    Registered User
    Join Date
    07-09-2014
    Location
    USA
    MS-Off Ver
    W7
    Posts
    2

    Macro causes a cell with a vlookup to delete vlookup and replace with a named cell

    Hi All,

    I created a tool with a save reports option. The SAVE DISTRICT choice goes through schools in a district (hidden in columns N-S) and unfortunately creates a minor problem....

    I would like to ask a troubleshooting question with the macro… I will message the file to you if you message me.

    You will notice on both tabs that I have added a “Print District” option. It works, but upon saving a district’s files, it deletes the formula in C3 and reverts the school name to the top selected school.

    Can you assist in fixing this macro text?
    Thanks,
    Jonathan


    MACRO

    Please Login or Register  to view this content.
    Problem again is that upon completing the printing, it replaces my vlookup with the FirstSchoolD value.
    Last edited by JBeaucaire; 07-10-2014 at 10:56 AM. Reason: Added missing CODE tags. Please read and follow the Forum Rules, link above in the menu bar. Thanks.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro causes a cell with a vlookup to delete vlookup and replace with a named cell

    You can see the last line of code does exactly what you don't want:
    Please Login or Register  to view this content.
    So, take that out?
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    07-09-2014
    Location
    USA
    MS-Off Ver
    W7
    Posts
    2

    Re: Macro causes a cell with a vlookup to delete vlookup and replace with a named cell

    If I remove the next statement, I get the error, For is lacking the Next...

    Basically, the macro is running through an excel column and in each cell with text, it is going through a save file process. It works, but in the end it maligns the excel.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro causes a cell with a vlookup to delete vlookup and replace with a named cell

    I didn't point to the NEXT R line of code to be removed, only the line above it. In your post #1 I highlighted just that one line as well, that's the only part to take out, nothing above or below that line, just that line.

+ 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. Macro to Replace Cell with VLOOKUP
    By borjasanz in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-20-2013, 01:00 PM
  2. using VBA Vlookup to replace cell values?
    By dinosaur1993 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-15-2013, 06:09 PM
  3. VLOOKUP and Delete or Replace or...
    By kgbonafide in forum Excel General
    Replies: 1
    Last Post: 07-27-2011, 04:13 PM
  4. Replies: 2
    Last Post: 04-18-2011, 10:34 AM
  5. [SOLVED] VBA Excel Macro to delete contents in named cell
    By reaa in forum Excel General
    Replies: 1
    Last Post: 01-03-2006, 04:20 PM

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