New Excel Forum

This forum has been moved to TeachExcel.com

Ask all future questions in the New Excel Forum.

ExcelKey

Macro to space out copied values

Macros, VBA, Excel Automation, etc.

Macro to space out copied values

Postby PSB » Mon Jun 06, 2016 2:00 pm

Hi, I periodically need to copy a row or column of sequential data and then paste the data with some number of columns or row separating each value. This is better illustrated with an example. If I copy cells A1 through E1 I would need to paste the data from A1 in cell A5. The contents of B1 would go in D5. The contents of C1 would go in G5. The contents of D1 to J5 and lastly, the contents of E1 would get pasted into M5. They key is that spacing required is a variable but, it's always the same value. In this case, I leave two blank cells between each value. The next time it might be 3 or 4 or 1 blank cell. Ideally, I'd highlight the data, invoke the macro, it would ask me to enter a value (the number of spaces between each cell pasted) and then I'd click on the cell where I want to start pasting the values. This sounds difficult because you’re dealing with clipboard data and not just a single cell. Any guidance would be much appreciated. Thanks!
  • 0

PSB
Rookie
 
Posts: 16
Joined: Dec 9, 2011
Reputation: 0

Re: Macro to space out copied values

Postby elavarasi » Thu Jul 07, 2016 5:16 am

Hello sir,

I need your help ,

I have a excel sheet
sheet 1
base age <14
chennai male 10 1
chennai female 1 2
mumbai male 2 3
mumbai female 3 4


i want output in sheet 2
chennai male 10 base
chennai female 1 base
mumbai male 2 base
mumbai female 3 base
chennai male 1 age <14
chennai female 2 age <14
mumbai male 3 age <14
mumbai female 4 age <14




Kindly help me sir

Thanks and Regards
  • 0

elavarasi
Rookie
 
Posts: 2
Joined: Jul 7, 2016
Reputation: 0
Excel Version: Excel 2010

Re: Macro to space out copied values

Postby elavarasi » Thu Jul 07, 2016 5:24 am

Any body please answer
  • 0

elavarasi
Rookie
 
Posts: 2
Joined: Jul 7, 2016
Reputation: 0
Excel Version: Excel 2010


Return to Macros and VBA Questions

Who is online

Users browsing this forum: Google [Bot] and 6 guests

cron