VBA copy active row and paste in the same worksheet

titoexcel

Board Regular
Joined
Mar 26, 2013
Messages
55
I would like to copy the active row and paste it right below (in the same worksheet) with columns "D" through "P" being null or just copy columns (A,B,C and the rest blank, but this is a table. I tried with my vba but i get an error that I can not do it in a table, but I see others doing it. This seems fairly simple but my brain is frozen.
worksheet name: "Outlook"

I also have a vlookup in column B on "Outlook" spreadsheet that is looking up against "ERPHeadCount" worksheet. Not sure if it can be copied or if we have to manually enter the formula everytime.

vlookup being used =VLOOKUP([@Resource],Table2,7,FALSE). Please help if you can.

This is my code below but it would not allow to add in the middle of the spreadsheet only on the last record.

Sub CopyConcatenate()
Dim ws As Worksheet
Dim rng As Range


Set ws = ThisWorkbook.Sheets("Outlook")


With ws

Set rng = .Rows(ActiveCell.Row)



rng.Copy



rng.Offset(1).Insert Shift:=xlDown


Application.CutCopyMode = False
End With
End Sub
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Code:
Sub btest()ActiveCell.EntireRow.Select
Selection.Copy
Selection.Offset(1).Insert
Selection.Offset(1).Select
End Sub

I tried this above and i still get an error that I can't modify a table. If anyone can please help i would greatly appreciate it.
 
Upvote 0

Forum statistics

Threads
1,215,516
Messages
6,125,285
Members
449,218
Latest member
Excel Master

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