+ Reply to Thread
Results 1 to 5 of 5

Do Until with If IsNumeric

  1. #1
    Registered User
    Join Date
    04-09-2015
    Location
    Washington, DC
    MS-Off Ver
    2009
    Posts
    3

    Do Until with If IsNumeric

    Hi all,

    I'm trying to construct a macro to track sales of particular products by week. I have week numbers along the horizontal axis (in Row 4), and product numbers along the vertical axis (in Column A). I would like the macro to find the previous week number on the horizontal axis, and if there is a product number in column A for that row, perform the VLOOKUP. If there is not a product number in that row, I would like to advance to the next cell. This should continue until the "**" at the bottom of the sheet.

    I can find the correct week number on the horizontal axis, but I think my Do loop is wrong - it's just advancing down the column without performing any VLOOKUPS.

    Here's the code I've used:

    Sub Macro1()

    **the first part of the code finds the correct week in Row 4**

    ActiveCell.Offset(2, 0).Activate

    Do Until ActiveCell.Value = "**"
    If IsNumeric(Cells(1, 1)) = True Then
    ActiveCell.Formula = "=VLOOKUP(RC1,'SA021'!C2:C16,15,0)"
    ElseIf IsNumeric(Cells(1, 1)) = False Then
    ActiveCell.Offset(1, 0).Activate
    End If

    Loop

    End Sub


    Any help would be greatly appreciated!
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by doyoc; 04-10-2015 at 12:40 PM. Reason: attached full spreadsheet

  2. #2
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: Do Until with If IsNumeric

    please share your whole code and/or workbook.

  3. #3
    Registered User
    Join Date
    04-09-2015
    Location
    Washington, DC
    MS-Off Ver
    2009
    Posts
    3

    Re: Do Until with If IsNumeric

    revised post with spreadsheet attached

  4. #4
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Do Until with If IsNumeric

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-09-2015
    Location
    Washington, DC
    MS-Off Ver
    2009
    Posts
    3

    Re: Do Until with If IsNumeric

    Thanks so much, sknkynts...works perfectly!

+ 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. Help with IsNumeric Syntax
    By TextMonkey in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-06-2014, 08:30 PM
  2. [SOLVED] IsNumeric Help
    By Brumbot in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-19-2013, 08:29 AM
  3. IsNumeric
    By Risdell in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-18-2010, 03:32 PM
  4. [SOLVED] Isnumeric
    By Richard in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-26-2006, 04:25 PM
  5. help with If Isnumeric
    By justchris in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-03-2005, 12:57 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