Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Hi all, Is it possible that someone could help me add to the macro shown below
Need to add "dp" as an extra choice to enter in col H sheet A, and have that shown as column E in sheet B Much appreciated if anybody can help Here is a pic of what I mean ![]() Sub paid() Sheets("Current").Select Dim ShA As Worksheet Dim ShB As Worksheet Dim DestCell As Range Dim TargetRng As Range Application.ScreenUpdating = False Set ShA = Worksheets("Current") Set ShB = Worksheets("Paid") 'Set DestCell = ShB.Range("A2") Set DestCell = ShB.Range("A" & Rows.Count).End(xlUp).Offset(1, 0) Set TargetRng = ShA.Range("F2", ShA.Range("F" & Rows.Count).End(xlUp)) For Each cell In TargetRng If cell.Value = "p" Then ShA.Range("A" & cell.Row).Resize(1, 2).Copy DestCell If cell.Offset(0, 2) = "ch" Then DestCell.Offset(0, 2) = cell.Offset(0, 1) Else DestCell.Offset(0, 3) = cell.Offset(0, 1) End If Set DestCell = DestCell.Offset(1, 0) cell.Value = "c" End If Next Application.ScreenUpdating = True End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
modify existing macro | Excel Programming | |||
modify existing macro | Excel Programming | |||
add vbyesno to existing macro | Excel Programming | |||
Macro to run an Existing Microsoft Access Macro | Excel Programming | |||
Change to existing macro | Excel Programming |