How to Skip cells while copying data

paata01

New Member
Joined
May 10, 2014
Messages
21
Hi all,
I am trying whole day how to copy cells, please help, here is what I try to do. I have data
A
B
C
and want to copy to another worksheet in this format
A
A
A
B
B
B
C
C
C

so when copying it puts "A" three times and moves to next cell.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Something like?...

Rich (BB code):
Sub copyIt()
    Dim c As Range
    For Each c In Sheets("Sheet1").Range("A1:A" & Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row)
        c.Copy Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1).Resize(3, 1)
    Next
End Sub

Change sheet names to suit
 
Last edited:
Upvote 0
Something like?...

Rich (BB code):
Sub copyIt()
    Dim c As Range
    For Each c In Sheets("Sheet1").Range("A1:A" & Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row)
        c.Copy Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1).Resize(3, 1)
    Next
End Sub

Change sheet names to suit

I copied this in VBA, but cant make it work. is formula general? I just changed sheet1 and sheet2 values, and renamed to names I used in excel. how should I check if it works and what inputs should I supply
Thanks
 
Upvote 0
Describe where you have placed the code and how you are trying to run it.
The data is whatever you want and it needs to be in column A of the sheet that was Sheet1 it gives the result on Sheet2.
 
Upvote 0
Hi paata01,

A way to check the code, (which works as you requested) is to paste it in a new unused workbook in the sheet1 module.

Then enter A, B, C in column A. Then run the code. Sheet2 has the results.

Maybe post the code as you changed it just for a look-see?

Regards,
Howard
 
Upvote 0
Describe where you have placed the code and how you are trying to run it.
The data is whatever you want and it needs to be in column A of the sheet that was Sheet1 it gives the result on Sheet2.

Thank you so much, it works. I forgot how to run macros. thanks again.
another small issue, i can't figure out how to do. please help
I have data on 6 rows and 2 columns, like this

tshirt tshirt
tshirt tshirt1
tshirt tshirt2

I want to type WORD tshirt just once on first cell and the rest depedent on this cell, I can do it with ALT ENTER, but cant add 1 and 2 at the end, how can i do it. 1 and 2 can be enything like "-SKU"
thanks
 
Upvote 0

Forum statistics

Threads
1,214,413
Messages
6,119,372
Members
448,888
Latest member
Arle8907

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