+ Reply to Thread
Results 1 to 1 of 1

Looping Ranges

  1. #1
    Registered User
    Join Date
    02-14-2005
    Location
    UK
    Posts
    1

    Question Looping Ranges

    Hi all,
    I'm a novice VBA/VB programmer.

    Basically the below runs when someone clicks a button. The purpose is to check if a reference is inputted, if so then check if its been updated and then put the date today in a different field if it has been updated.

    The problem is that eventually there could be 1000s references so I need to loop the code.

    I can get the code to loop the same number of times as there is references in column A using a for loop but that only repeats the same code for row 2. I want it to move down a row each time it loops.

    Any help would be greatly appriciated.

    Karen


    chips(0) = ""
    chips(1) = "Updated"
    chips(2) = "Not updated"


    Dim today As Date
    today = Now

    Dim message As String
    message = "Status has not been updated for "

    If Range("A2").Value <> chips(0) And Range("D2").Value = chips(1) Then
    Range("B2").Select
    ActiveCell.Value = today
    ElseIf Range("B2").Value <> chips(0) And Range("D2").Value = chips(2) Then
    Range("B2").Select
    ElseIf Range("A2").Value <> chips(0) And Range("D2").Value <> chips(2) Or Range("B2").Value <> chips(0) And Range("D2").Value <> chips(1) Then
    Range("A2").Select
    MsgBox message + ActiveCell.Text + "."
    End If
    Last edited by purple_m; 02-14-2005 at 08:28 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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