Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Need slight modification on macro below

I would really apprecaite any help on this.

I need to make a modification in the macro below

I now need to populate Destinateion Coloum F with value from Source Coloum F
when Value in Coloum C is 1.
If value is anythign else then the Source Value from Coloum F will go to
Coloum I:

Thanks so much

Sam Commar

Macro Below:

-----------------------------------------------


Public Sub ProcessData()
Const TEST_COLUMN As String = "A" '<=== change to suit
Dim i As Long
Dim iLastRow As Long
Dim cell As Range
Dim sh As Worksheet

With ActiveSheet

iLastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
For i = 1 To iLastRow 'iLastRow to 1 Step -1

If Not IsError(Application.Match(.Cells(i, "C").Value, _
Array("8c", 8, "8b", "8d", 60, "7W", "7T"), 0)) Then
.Cells(i, "I").Value = .Cells(i, "F").Value
Else
.Cells(i, "I").Value = ""
End If
If Not IsError(Application.Match(.Cells(i, "C").Value, _
Array("8c", 8, "8b", "8d", 60, "7W", "7T"), 0)) Then
.Cells(i, "I").Value = .Cells(i, "C").Value
Else
.Cells(i, "I").Value = ""
End If
If .Cells(i, "C").Value = 2 Or _
.Cells(i, "C").Value = 3 Or _
.Cells(i, "C").Value = 4 Or _
.Cells(i, "C").Value = 10 Then
.Cells(i, "H").Value = .Cells(i, "D").Value
Else
.Cells(i, "H").Value = ""
End If
If .Cells(i, "C").Value = 2 Or _
.Cells(i, "C").Value = 3 Or _
.Cells(i, "C").Value = 4 Or _
.Cells(i, "C").Value = 10 Then
.Cells(i, "G").Value = .Cells(i, "C").Value
Else
.Cells(i, "G").Value = ""
End If
.Cells(i, "F").Value = ""
If .Cells(i, "C").Value = 5 Then
.Cells(i, "E").Value = .Cells(i, "D").Value
Else
.Cells(i, "E").Value = ""
End If
If .Cells(i, "C").Value < 1 Then
.Cells(i, "D").Value = ""
End If
If .Cells(i, "B").Value < 51 Then
.Cells(i, "C").Value = Cells(i, "B").Value + 1000
Else
.Cells(i, "C").Value = Cells(i, "B").Value
End If
.Cells(i, "B").Value = "BATCH01"
.Cells(i, "A").Value = "EP7"

Next i

.Rows(1).Insert
.Range("A1").Value = "CO CODE"
.Range("B1").Value = "BATCH ID"
.Range("C1").Value = "FILE #"
.Range("D1").Value = "REG HOURS"
.Range("E1").Value = "O/T HOURS"
.Range("F1").Value = "REG EARNINGS"
.Range("G1").Value = "HOURS 3 CODE"
.Range("H1").Value = "HOURS 3 AMOUNT"
.Range("I1").Value = "EARNINGS 3 CODE"
.Range("J1").Value = "EARNING 3 AMOUNT"

End With

End Sub



Reply
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
Excel - Slight edit of the macro below should do the trick! Add filename to cell A1 upon merge. Stuart[_3_] Excel Programming 1 October 31st 06 09:28 PM
Need a slight modification to code Dean[_9_] Excel Programming 3 March 1st 06 03:31 PM
need help with macro modification please excelguru Excel Programming 0 September 14th 05 08:18 PM
Need Macro Modification Phil Hageman[_3_] Excel Programming 2 June 2nd 04 12:26 PM
Slight adjustment needed for Macro Bob Vance Excel Programming 2 July 13th 03 06:31 AM


All times are GMT +1. The time now is 11:38 PM.

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"