Macro needed to insert 4 rows in table, copy data from above, copy data from another sheet and paste special (transpose values) to those new rows...repeat till table complete

Christine Potter 0 Reputation points
2024-09-17T20:10:05.2766667+00:00

Hey smart people! I'm a novice at macros and have found myself in a little too deep to handle this task with a macro and don't know VBA language to get this done.

I have a spreadsheet with multiple sheets. My macro needs to:

  1. Select the main sheet.
  2. Make task relative.
  3. drop down 1 line
  4. Insert 4 lines
  5. Copy the data from one cell above to the same cells in those 4 new lines
  6. Copy images (https://...) from Other Sheet over to the main sheet to those new lines into the appropriate cell of the newly inserted lines. Those images are on the one row in 4 cells (4 columns) in the Other Sheet and need to be transposed to the one cell (1 column) in the next 4 lines down and just as values (not formulas).
  7. then go down to the next line item to set up for the next repetitive motion till all items in the Main Sheet table are completed.

As data is input differently from the month before, the Main Sheet and Other Sheet will be different in number of filled rows each time so I need to make the macro stop after it can't find any more data to alter.

Can anyone help steer me to the best way to conquer this, please?

Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1,842 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,861 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Barry Schwarz 2,831 Reputation points
    2024-09-17T21:30:55.3966667+00:00

    Turn on Macro recording. Perform tasks 1-6 manually. Turn off macro recording.

    Study the resulting macro to learn at least some VBA basics,

    Post the macro and tell us specifically what data task 7 should work on and how it can determine all items are complete. It wouldn't hurt to show us before and after sample data either.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.