+ Reply to Thread
Results 1 to 5 of 5

Help coding Logical function in VBA code

Hybrid View

Wiggert Help coding Logical function... 12-08-2009, 08:11 PM
chrns12 Re: Help coding Logical... 12-09-2009, 01:22 AM
Wiggert Re: Help coding Logical... 12-09-2009, 02:47 PM
Wiggert Re: Help coding Logical... 12-10-2009, 09:56 AM
Wiggert Re: Help coding Logical... 12-10-2009, 12:00 PM
  1. #1
    Registered User
    Join Date
    12-08-2009
    Location
    Delft, The Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Help coding Logical function in VBA code

    Ok, I came up with the following code but I would like to select the entire row or do untill cell is empty. Untill now I haven't been able to integrate that into the code.

    Anyone?

    The search code 'also as attachment.

    Option Explicit
    Dim wsBD2 As Worksheet

    Dim rownumber As Integer
    Dim columnnumber As Integer
    Dim rowProjectNumber As Integer

    Dim columnfrom As Integer
    Dim columnto As Integer

    Dim projectTitle As Integer

    Sub Find_Something()

    Set wsBD2 = Worksheets("Blad1")

    'Activate your starting column and cell
    wsBD2.Range("F4").Activate

    rownumber = 4

    columnfrom = wsBD2.Range("E4").Column
    columnto = wsBD2.Range("J4").Column

    'Set the number of cells in the row you want to search through, example: 1 to 1000
    For rowProjectNumber = wsBD2.Range("D5") To wsBD2.Range("D6")
    'Set projectTitle to whatever you are looking for, example: wsBD2.Range("B2").Value
    projectTitle = wsBD2.Range("D" & CStr(rowProjectNumber)).Value

    'Set the number of cells in the column you want to search through, example: 1 to 1000
    For columnnumber = columnfrom To columnto

    'Check for a match to projectTitle
    wsBD2.Cells(rownumber, columnnumber).Activate

    If ActiveCell.Value = projectTitle Then
    'Do something with what your match
    MsgBox "Found"
    End If

    Next columnnumber

    Next rowProjectNumber

    End Sub
    Thanks, Wiggert
    Attached Files Attached Files

+ 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