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

Applying a macro repeatedly in a worksheet

0

Hello to all.     I need help in macro coding.

In my excel worksheet there are 1680 rows  with values in columns A ,B.C,and D   . (A1:D1680)    No Blank cell.

I have to do the following actions.

A.           1. Select row 1 (or select row 2 if it would be easier for doing the next step)

              2. Insert 8 rows below row 1.

              3. Select A1,B1,C1

              4. Copy values in A1, B1, C1.

              5. Paste the values in the inserted 8 rows (A2:C9)

              6. Select D1

              7. Copy the value in  D1

              8. Paste that value in E2,F3,G4,H5,I6,J7,K8,L9.

  B.            I have to do similar actions for the present row 10(which was originally row 2 before ' A'    was performed)

  C.            I have to do similar actions for all the 1680 rows mentioned at the beginning.

For performing 'A' --- I followed the record macro procedure and I could do it.

  For performing 'B' and 'C' I do not know how to write the code( use of OFFSET, LOOP For next,Do  until  etc).

Will somebody help me?

Answer
Discuss

Discussion

The process is for you to write code - worst case, just record it - test what you have so that you know what it dioes, describe what it doesn't do and ask for help making it do what you want.
It's essential that you post the code you have and that you tried it.
Variatus (rep: 4889) Jun 3, '21 at 7:29 pm
Thank you so much. I shall try to do so.
Slowlearner Jun 5, '21 at 3:58 am
Add to Discussion



Answer the Question

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