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?
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
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.
 
Upvote 0

Forum statistics

Threads
1,214,622
Messages
6,120,576
Members
448,972
Latest member
Shantanu2024

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top