0

I hope you will be able to help me.

I need to do the following in Excel:

a. Newest event comes on top and the former event moves 1 row down (below), and;

b. After newest event has been copied and pasted to 1 row down, the first row is clear of any data (blank cells);

c. Now a new event comes on top of the former event. If there is also a new date involved than everything the old events and dates moves at least 2 rows down and leaves a blank row in between. And so on until a full month has been reached;

d. After that the entire sheet/month is copied to an archive.

I've been trying to write the code for this in VBA, but thus far it's not working. To be honest, I can't code and I've trying to do this through youtube and everything I can find online.

I would greatly appreciate any help I can get on this one. I'm new here so I can't a picture just yet. Hopefully somebody understands my questions.

Again thanks for any help on this one.

enter image description here

The picture describes pretty much how I want this to work

Stanley
  • 1
  • 1
  • 2
    Hi Stanley. Can you show the code that you have tried so far, even if it doesn't work yet? (see https://stackoverflow.com/help/how-to-ask). – John Apr 03 '21 at 00:25
  • Hello John, thank you for your response! Appreciate it. Thus far I've got the following code that sort of works: Sub MoveCopyRows() 'Copy and Paste Row Range("7:7").Copy Range("8:8").Insert End Sub This code controls the part where it will copy a blank row and pasting it 1 row below and also shifting all the other rows 1 row downward. Problem is that for this to work, I need to keep the top row blank. See picture. Now I'm trying to add another button which should copy paste the entire month to another sheet. By the way, everything is in Dutch. – Stanley Apr 06 '21 at 09:21
  • I see that I'm able to post a picture just yet Sub MoveCopyRows() 'Copy and Paste Row Range("7:7").Copy Range("8:8").Insert End Sub – Stanley Apr 06 '21 at 09:25

1 Answers1

0

I'm answering my own questions, because I sort figured it out and I'm really excited. So the code is not perfect, I know but it works :)

There are two type of code running: 1. Sub MoveCopyRows()

'Copy and Paste Row
Range("10:10").Copy
Range("11:11").Insert

End Sub

And

2. Sub CutInsertSheet()

'Cut or Copy and Paste to another worksheet

Worksheets("Overdracht").Range("11:35").Cut
Worksheets("Berichtenhistorie").Range("6:6").Insert

Application.CutCopyMode = False

End Sub

This coding has got me hooked. Now I'm going to see, if I can combine them and if I would be able to change the cell color automatically after adding a new row. Wish me luck everybody! :) And before I forget, thx everybody for your help!

Stanley
  • 1
  • 1