Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Simple Macro to copy line 2 to line 1

0

Hi Team,

I would like to have a macro which copies the entire row number 2 to row number 1 within same sheet. Say sheet name is "Karthik".

Thanks,

Karthik

Answer
Discuss

Answers

0

Here is a simple line of code to do that:

Sub copy_row()

Range("A2").EntireRow.Copy Range("A1")

End Sub

It works on whatever sheet you are looking at when you run the macro, whichever sheet is active.

Discuss


Answer the Question

You must create an account to use the forum. Create an Account or Login