-
May 11th, 2017, 04:38 AM
#1
Thread Starter
Junior Member
just need help on this...
Public Sub PopulateFormulas(thisSheet As Worksheet)
Dim lastRow As Long
lastRow = thisSheet.UsedRange.Rows.Count
thisSheet.UsedRange.Cells(2, "T").FormulaR1C1 = "=VLOOKUP(RC[-10],roster!C[-19]:C[-16],4,0)"
thisSheet.UsedRange.Cells(2, "U").FormulaR1C1 = "=VLOOKUP(RC[-2],roster!C[-19]:C[-17],5,0)"
thisSheet.UsedRange.Cells(2, "V").FormulaR1C1 = "=IF(RC[-8]=R1C,""1"",""0"")"
thisSheet.UsedRange.Cells(2, "W").FormulaR1C1 = "=IF(RC[-9]=R1C,""1"",""0"")"
thisSheet.UsedRange.Cells(2, "X").FormulaR1C1 = "=IF(RC[-10]=R1C,""1"",""0"")"
thisSheet.UsedRange.Cells(2, "Y").FormulaR1C1 = "=IF(RC[-11]=R1C,"".25"",""0"")"
thisSheet.UsedRange.Cells(2, "Z").FormulaR1C1 = "=IF(RC[-11]=R1C,"".25"",""0"")"
thisSheet.UsedRange.Cells(2, "AA").FormulaR1C1 = "=IF(RC[-13]=R1C,"".25"",""0"")"
thisSheet.UsedRange.Cells(2, "AB").FormulaR1C1 = "=SUM(RC[-6]:RC[-1])"
'need help on this.
thisSheet.UsedRange.Cells.EntireRow.AutoFill Destination:=Range("t2:AA2"), Type:=xlFillDefault
thisSheet.Range("V2").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
thisSheet.Range.Cells(2, "T").NumberFormat = "0.00"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|