SAMCRO2014
Board Regular
- Joined
- Sep 3, 2015
- Messages
- 158
I am trying to copy and paste projection amounts from the worksheet "SPS" to the worksheet "Data". I need the macro to find the first blank cell in column N and paste the information in the adjacent cell in Column O. For example, if the fist blank cell in column N is N13, I need the data to paste in O13. This should be the end results:
<tbody>
</tbody>
This is my coding but it is not working:
'Copy and paste Projection Amount from “SPS” to “Data”
Dim SPS As Worksheet
Set SPS =ThisWorkbook.Sheets("SPS+")
Dim Data As Worksheet
Set Data =ThisWorkbook.Sheets("Data")
Dim LastRowText As Long
Dim lastO As Long
Dim z As Long
Dim LastRowData2 As Long
LastRowData2 = Data.Cells(Rows.Count,8).End(xlUp).Row
Range("N3:N" &LastRowSPS2).Copy
With Data
lastO =.Range("N" & Rows.Count).End(xlUp).Row + 1
.Range("N"& lastO).PasteSpecial xlPasteColumnWidths
.Range("N"& lastO).PasteSpecial xlPasteValues
End With
For z = LastRowData2 To 2 Step -1
If Cells(z, 12).Value ="" Then
Cells(z, 14).CutDestination:=Data.Cells(z, 15)
End If
Next z
Can someone help me out please
(Column L) | (Column M) | (Column N) | (Column O) |
Pay Period For | Fiscal | Salary Actuals | Salary Projections |
201831 | Current | $ 52.97 | |
201833 | Current | $ 1,059.30 | |
201834 | Current | $ 52.97 | |
201833 | Current | $ 264.83 | |
201834 | Current | $ 1,271.16 | |
201832 | Current | $ 529.66 | |
| Current | | $ 3,977.00 |
| Current | | $ 4,044.16 |
| Current | | $ 9,580.42 |
| Current | | $ 9,240.42 |
| Current | | $ 4,348.90 |
| Current | | $ 4,348.90 |
| Current | | $ 5,401.41 |
| Current | | $ 5,091.31 |
| Current | | $ 4,348.90 |
| Current | | $ 4,705.54 |
| Current | | $ 4,348.90 |
<tbody>
</tbody>
This is my coding but it is not working:
'Copy and paste Projection Amount from “SPS” to “Data”
Dim SPS As Worksheet
Set SPS =ThisWorkbook.Sheets("SPS+")
Dim Data As Worksheet
Set Data =ThisWorkbook.Sheets("Data")
Dim LastRowText As Long
Dim lastO As Long
Dim z As Long
Dim LastRowData2 As Long
LastRowData2 = Data.Cells(Rows.Count,8).End(xlUp).Row
Range("N3:N" &LastRowSPS2).Copy
With Data
lastO =.Range("N" & Rows.Count).End(xlUp).Row + 1
.Range("N"& lastO).PasteSpecial xlPasteColumnWidths
.Range("N"& lastO).PasteSpecial xlPasteValues
End With
For z = LastRowData2 To 2 Step -1
If Cells(z, 12).Value ="" Then
Cells(z, 14).CutDestination:=Data.Cells(z, 15)
End If
Next z
Can someone help me out please