LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Junior Member
 
Posts: 2
Default Add to existing macro

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
modify existing macro SteveDB1 Excel Programming 7 March 11th 09 06:55 PM
modify existing macro SteveDB1 Excel Programming 2 November 18th 08 12:16 AM
add vbyesno to existing macro SteveDB1 Excel Programming 6 September 8th 08 10:42 PM
Macro to run an Existing Microsoft Access Macro Paul Dennis Excel Programming 1 November 6th 07 02:48 PM
Change to existing macro Jerry[_14_] Excel Programming 5 November 4th 03 01:51 PM


All times are GMT +1. The time now is 06:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"