Simple macros

Jatimir

New Member
Joined
May 9, 2016
Messages
3
Welcome,

At the beginning I would like to point out that I'm new to macros. It's basically my first day of using this mechanism. I have encountered the following problem:

I have this kind of data in one worksheet:

BACHORZTOMASZ1983-10
BARTKOWIAKPATRYK1983-09
BARTKOWIAKMICHAŁ1983-04
BOCIANMARIA1983-12
CHOJNACKAKATARZYNA1984-04

<tbody>
</tbody>

I would like to copy it to another worksheet and have it seperated by let's say 3 rows. What I have already accomplished without any significant difficulties is coping these data seperated, but what my macro does is to copy each 3rd line of initial data. I also tried relative cell reference, but without desired result.

I'm sorry for any possible grammar mistakes.

Any help really appreciated.
Radek
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Sub CopyPastLast3Rows()
ActiveSheet.Cells(Cells(Rows.Count, 1).End(xlUp).Row, 1).Select
Range(Selection, Selection.Offset(-2, 2)).Copy Sheets("Sheet3").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
End Sub
 
Upvote 0
Thank you for your anwser, it does work, but I meant a completely different thing. I would like to do something like this:

In first worksheet I have some data: name, surname, etc.

1. MASZTALERZ ŁUKASZ 1983-10-02
2. MICHALCZYK KATARZYNA 1983-06-01
3. MISIOREK JAN 1983-06-02
4. NAWROT BARBARA 1983-09-01
5. PALACZ WALDEMAR 1983-11-02
6. PAWŁOWSKI TOMASZ 1984-01-01
7. PIECHOCKI TOMASZ 1983-02-01
8. STRYCZNIEWICZ KRZYSZTOF 1983-08-02

and in the second worksheet I would like to have:
1. MASZTALERZ ŁUKASZ 1983-10-02


2. MICHALCZYK KATARZYNA 1983-06-01


3. MISIOREK JAN 1983-06-02


4. NAWROT BARBARA 1983-09-01
etc.

The result of my macro is:
1. MASZTALERZ ŁUKASZ 1983-10-02


4. NAWROT BARBARA 1983-09-01


7. PIECHOCKI TOMASZ 1983-02-01
etc.

Sorry if my explanation isn't clear enough.
 
Upvote 0

Forum statistics

Threads
1,215,860
Messages
6,127,378
Members
449,382
Latest member
DonnaRisso

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