Results 1 to 10 of 10

Several IF statements that should be And statements

Threaded View

  1. #1
    Registered User
    Join Date
    05-19-2014
    Posts
    11

    Several IF statements that should be And statements

    I am trying to write a code to copy information from one worksheet to another that has IF Statements because of criteria that needs to be met in certain cells. But for some reason, it's not picking up the 2nd IF statement. It's giving me every type. Here is the code.

    Sub BuyertoIssued()
    Dim ws As Worksheet
    Set ws = Sheets("Buyer to Issued")
    ws.Rows("2:" & Rows.Count).ClearContents
    
    a = Worksheets("Bid Worklog").Cells(Rows.Count, 1).End(xlUp).Row
    
    For I = 2 To a
    
    If Worksheets("Bid Worklog").Cells(I, 1).Value = "Active" Then
        If Worksheets("Bid Worklog").Cells(I, 29).Value = "IFB" Then
           If Worksheets("Bid Worklog").Cells(I, 53).Value > 15 Then GoTo CopyRow1
            End If
    CopyRow1:   Worksheets("Bid Worklog").Rows(I).Copy
       
       Worksheets("Buyer to Issued").Activate
       b = Worksheets("Buyer to Issued").Cells(Rows.Count, 1).End(xlUp).Row
       Worksheets("Buyer to Issued").Cells(b + 1, 1).Select
       ActiveSheet.Paste
       Worksheets("Bid Worklog").Activate
       
                End If
            
                
    Next
    Application.CutCopyMode = False
    
    End Sub
    I've read about CASE statements, but I'm confused on that part. What is so weird, is that this was working, but then I changed the cell locations so now it's not picking it up correctly. Any help would be appreciated.
    Thank you.
    Last edited by vanfel; 11-23-2021 at 11:47 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] If statements and Select statements in active controls userform
    By LaSouth1776 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-05-2020, 03:17 AM
  2. Reading If statements and formulating values from if statements
    By crnam in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-16-2013, 05:20 AM
  3. questions with if statements and nested if statements
    By Pat Excel in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 02-03-2013, 01:41 PM
  4. Multiple nested IF statements and AND statements
    By TonyGetz in forum Excel General
    Replies: 2
    Last Post: 12-14-2010, 03:07 AM
  5. Nested If statements / logic statements
    By Brainless_09 in forum Excel General
    Replies: 3
    Last Post: 06-17-2009, 02:59 PM
  6. Replies: 12
    Last Post: 05-15-2009, 08:38 AM
  7. [SOLVED] operator statements, shorting when reusing one of the statements?
    By KR in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-04-2005, 02:05 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