Results 1 to 16 of 16

Thread: I could use a hand with this one.

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2005
    Posts
    11

    Resolved I could use a hand with this one.

    Ok I have code here that will move the text that is highlighted in yellow in any cell in row C from worksheet A to the same postion in worksheet B.

    VB Code:
    1. Dim aColor As Integer
    2.     Dim aCell As Range
    3.     Dim aWorksheet As Worksheet
    4.     Dim bWorksheet As Worksheet
    5.     Set aWorksheet = Worksheets("DATA")
    6.     Set bWorksheet = Worksheets("NegativeFMs")
    7.    
    8.     r1 = 2
    9.     c1 = 1
    10.     a1 = 1
    11.     b1 = 1
    12.     ' get color of  field C
    13.     ' if it is yellow the copy to another workbook
    14.     Do While aWorksheet.Cells(r1, c1 + 2) <> ""
    15.         Set aCell = aWorksheet.Cells(r1, c1 + 2)
    16.         aColor = aCell.Interior.ColorIndex
    17.         If aColor = 6 Then
    18.             bWorksheet.Cells(a1, b1).Value = "'" & aWorksheet.Cells(r1, c1 + 2).Value
    19.             a1 = a1 + 1
    20.         End If
    21.         r1 = r1 + 1
    22.     Loop
    23. End Sub



    But what i want to do is instead of moving the text of the yellow cell in row C to worksheet b, I want to move the whole row of any text in any cell thats bold in worksheet a to worksheet b

    Example:
    Worksheet A
    A B C D E F G
    N N Y N N N N
    T T T S S T T

    Workshhet B
    A B C D E F G
    N N Y N N N N

    I hope this makes sense. This would really help me out ALOT, If not thanks for taking a look at it.
    Last edited by The_Rookie; Jan 6th, 2005 at 03:45 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width