+ Reply to Thread
Results 1 to 5 of 5

Issue with basic VBA code If command

  1. #1
    Registered User
    Join Date
    05-19-2015
    Location
    Boulder, Colorado
    MS-Off Ver
    2016
    Posts
    45

    Issue with basic VBA code If command

    Hi I'm brand new to VBA and I'm having a little trouble with a fairly basic code which is suppose to select a column in a specific worksheet in my database and replace every row that has "Yes" with "Reminder Sent". This I plan to run together with the macro I set up which automatically sends emails to contacts in my database, I was hoping I could just copy/paste the new "Sub" to the bottom of my email macro code.

    Here's the code I've been attempting, It returns a type mismatch error. I've tried doing research on youtube and google but nothing is bringing me success so If anyone has a clue of what could be the issue I'd really appreciate it.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Issue with basic VBA code If command

    you have not declared/determined what the value of ROW_number is

    also

    note the difference between AND and &
    AND is a function
    http://www.techonthenet.com/excel/formulas/and_vba.php

    & is an operator
    http://www.techonthenet.com/excel/formulas/concat2.php
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Issue with basic VBA code If command

    something like this would work
    Please Login or Register  to view this content.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Issue with basic VBA code If command

    Your code will only change the value of the variable Follow_up_column, it won't change the value in the cell.

    Try this.
    Please Login or Register  to view this content.
    PS I've assumed row_number has been given a value elsewhere.
    If posting code please use code tags, see here.

  5. #5
    Registered User
    Join Date
    05-19-2015
    Location
    Boulder, Colorado
    MS-Off Ver
    2016
    Posts
    45

    Re: Issue with basic VBA code If command

    Thank you all very much for your help, I've figured out where I've made an issue and have solved it.

+ 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. Visual basic command button code help?
    By chicken9 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-26-2013, 10:40 PM
  2. [SOLVED] Basic VBA Vlookup Issue
    By NeedForExcel in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-23-2013, 01:24 PM
  3. Basic issue with variables
    By milkman2500 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-21-2012, 05:19 PM
  4. [SOLVED] Basic lookup command?
    By maxashton in forum Excel - New Users/Basics
    Replies: 8
    Last Post: 10-25-2012, 10:26 AM
  5. Basic drop-down issue
    By stug in forum Excel General
    Replies: 1
    Last Post: 07-09-2012, 04:52 AM
  6. Basic Loop command
    By Big Chris in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-29-2006, 05:17 PM
  7. Is there a command in visual basic to move down one space, e.g. m.
    By Brent in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-27-2005, 09:05 PM
  8. basic commandbar issue
    By upstate_steve in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-15-2005, 12:49 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