Editing range, copy two columns and cell

bubsk

New Member
Joined
Mar 24, 2020
Messages
8
Office Version
  1. 2019
Platform
  1. Windows
VBA Code:
       Sub t3()
Dim c As Range, sh1 As Worksheet, sh2 As Worksheet, col As Long
Set sh1 = Sheets("A")
Set sh2 = Sheets("Import")
With sh1
For Each c In .Range("J2", .Cells(Rows.Count, 10).End(xlUp))
With Sheets(CStr(c.Value))
.Range(.Range("A9:C9"), .Range("A9:C9").End(xlDown)).Copy
End With
If sh2.Range("N1") = "" Then
sh2.Range("N1").PasteSpecial xlPasteValues
Else
sh2.Cells(Rows.Count, 14).End(xlUp)(2).PasteSpecial xlPasteValues
End If
Application.CutCopyMode = False
Next
End With
End Sub


.Range(.Range("A9:C9"), .Range("A9:C9").End(xlDown)).Copy

how to edit that line to copy only A9 and C9 .End(xlDown)), just without B column and value from C4 cell?
 

Some videos you may like

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

LazyBug

Board Regular
Joined
Feb 28, 2020
Messages
146
Office Version
  1. 2010
Platform
  1. Windows
Hello!
how to edit that line to copy only A9 and C9 .End(xlDown)), just without B column
VBA Code:
Dim c As Long
c = Cells(Rows.Count, 1).End(3).Row
With ActiveSheet
Application.Union(.Range("A9:A" & c), .Range("C9:C" & c)).Copy
End With
value from C4 cell?
Dont see any mention of C4.
 

Watch MrExcel Video

Forum statistics

Threads
1,119,098
Messages
5,576,123
Members
412,697
Latest member
ahem27
Top