Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code to mimic vlookup
I am trying to create a macro that will do the following.
1). Look in a column on a one worksheet, going row by row, for a specified text value. 2). If the value is found, then the value in the column to the left should be copied. 3). The copied value should be pasted in a seperate worksheet in a specified column. 4). The process should repeat until all matches in the first sheet have been found, copied, and pasted in separate rows on the second worksheet. The following is my ineffective code, at present. Any help is appreciated! Sub Business_Populate() Dim j As Long Dim k As Long With Application .Calculation = xlCalculationManual .ScreenUpdating = False Sheets("Setup Form").Select Range("d4:d33").Select For j = Selection.Cells.Count To 1 Step -1 If Selection.Cells(j) = "Business" Then Selection.Cells(j, "d").Offset(0, -3).Copy End If Next j Sheets("Project Completion Costs").Select Range("e10,e43").Select For k = Selection.Cells.Count To 34 Step 1 If Cells(k, "e") = "" Then Cells(k, "e").Select ActiveSheet.Paste End If Next k End With End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Mimic a watermark | Excel Discussion (Misc queries) | |||
Mimic Undo actions | Excel Programming | |||
mimic Working Days in ATP | Excel Programming | |||
[URGENT]How to mimic the toolbar zoom button from code | Excel Programming | |||
Help creating mimic input box | Excel Programming |