ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy Range / Including Adjacent Cells - into Existing Worksheet. (https://www.excelbanter.com/excel-programming/381148-copy-range-including-adjacent-cells-into-existing-worksheet.html)

[email protected]

Copy Range / Including Adjacent Cells - into Existing Worksheet.
 
Hello-

Hopefully an easy question but I cannot find an answer and need some
guidance.

All functions occur in same workbook.

I need to find a way with VBA to pull all non-blank cells ( dates )
from column N of worksheet5 along with the number adjacent to it in
column O and paste into column J&K of sheet2 of the same workbook.

Again probably easy but I'm muddling my way through and it's eaten up
most of my night. Any help would be appreciated.

Chuck


Gary''s Student

Copy Range / Including Adjacent Cells - into Existing Worksheet.
 
To minimize typing I am using sheets named "s2" and "s5":


Sub buckets()
Set s2 = Sheets("s2")
Set s5 = Sheets("s5")

n = s5.Range("N" & Rows.Count).End(xlUp).Row

For i = 1 To n
If IsEmpty(s5.Cells(i, "N")) Then
Else
Set r1 = Range(s5.Cells(i, "N"), s5.Cells(i, "O"))
Set r2 = s2.Cells(i, "J")
r1.Copy r2
End If
Next
End Sub

--
Gary's Student
gsnu200701


" wrote:

Hello-

Hopefully an easy question but I cannot find an answer and need some
guidance.

All functions occur in same workbook.

I need to find a way with VBA to pull all non-blank cells ( dates )
from column N of worksheet5 along with the number adjacent to it in
column O and paste into column J&K of sheet2 of the same workbook.

Again probably easy but I'm muddling my way through and it's eaten up
most of my night. Any help would be appreciated.

Chuck




All times are GMT +1. The time now is 02:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com