Showing posts with label vba. Show all posts
Showing posts with label vba. Show all posts

Tuesday, December 11, 2007

more vba

Excel’s VLOOKUP Function How to Use It and How to Nest It

Excel VBA: No Experience Necessary - Lesson 1
Excel VBA: No Experience Necessary - Lesson 2
Excel VBA: No Experience Necessary - Lesson 3
Excel VBA: No Experience Necessary - Lesson 4
Excel VBA–No Experience Necessary: Lesson 5



Sub TestPings() Dim cell As Range Dim astr() As String
Excel FAQ - Excel 101 - Xtreme Visual Basic Talk
Excel - My Excel Pages
Examples
Getting Started with Macros and User Defined Functions
VB(A) functions
Excel for Windows Visual Basic for Applications 101
Regular Expressions
regexp Patterns
VB(A) functions
Excel - Xtreme Visual Basic Talk
Excel FAQ - Excel 101 - Xtreme Visual Basic Talk
Kickbutt VBA Find Function - Excel Help & VBA Help
excel-vba-findall-method


=========================================================
Sub Comp()
Dim rSource As Range, rTarget As Range, SourceRow%, TargetRow%

Set rSource = ActiveWorkbook.Sheets(2).Range("A2").CurrentRegion
Set rTarget = ActiveWorkbook.Sheets(1).Range("A2").CurrentRegion

For SourceRow = 2 To rSource.Rows.Count
For TargetRow = 2 To rTarget.Rows.Count
If rSource.Cells(SourceRow, 8).Value = rTarget.Cells(TargetRow, 8).Value And _
rSource.Cells(SourceRow, 3).Value = rTarget.Cells(TargetRow, 3).Value And _
rSource.Cells(SourceRow, 6).Value = rTarget.Cells(TargetRow, 6).Value Then
rTarget.Cells(TargetRow, 4).Value = rSource.Cells(SourceRow, 4).Value
rTarget.Cells(TargetRow, 5).Value = rSource.Cells(SourceRow, 5).Value
rTarget.Cells(TargetRow, 7).Value = rSource.Cells(SourceRow, 7).Value
End If
Next TargetRow
Next SourceRow
End Sub

Saturday, December 8, 2007