Visual Basic Selecting and copying non-consecutive cells

Fran C

New Member
Joined
Apr 13, 2011
Messages
2
Hello,

I hope someone can help:)

I am completely new to <ACRONYM title=vBulletin>VB</ACRONYM> so I apologies if this seems like a ridiculous question.

All I am trying to do is select the last used cell in a column and then copy some non-consecutive cells within that same row. The cells I need are from columns A,E,F,M and P. The purpose of this is to transpose on to another worksheet, I have this code and need no assistance with this it is just selecting and copying the non consecutive cells that I am having the issue with.

This is my code which at the moment only finds, selects and copies the last cell in column A.

Range("A6").Select
Cells(Cells.Rows.Count, "A").End(xlUp).Select
Selection.Copy
Sheets("Info Transfer").Select
Range("D4").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Range("D4").Select

I would be really grateful for some help on this.

Thank You

<!-- / message -->
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Try...

Code:
[font=Verdana]    [color=darkblue]Dim[/color] LastRow [color=darkblue]As[/color] [color=darkblue]Long[/color]

    LastRow = Cells(Rows.Count, "A").End(xlUp).Row
    
    Range("A" & LastRow & ",E" & LastRow & ",F" & LastRow & ",M" & LastRow & ",P" & LastRow).Copy
    
    Sheets("Info Transfer").Range("D4").PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:=False, Transpose:=[color=darkblue]True[/color]
    [/font]
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,712
Members
452,939
Latest member
WCrawford

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