Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
EliseT
 
Posts: n/a
Default insert a blank in every second line of a row

I have a table with hourly values, but need to use them with half an hour
values. Im therefore trying to make the table twice as long, with blanks in
every second (or the best would be averages in every second) and the "next"
from the original list as the next entry.
  #2   Report Post  
Posted to microsoft.public.excel.misc
macropod
 
Posts: n/a
Default insert a blank in every second line of a row

Hi Elise,

You could do this with a macro, but for a one-off that's more complicated
than necessary.

Suggested solution:
.. in an empty column on row 1, enter the formula:
=ROW()*2-1
.. copy this down to your last row.
..below you last row, insert the formula:
=A1+1
replacing 'A' with your column letter.
.. copy this formula down for as many rows as you did with the first formula
(hint: the last # should be one more than was calculated with the first
formula
.. copy this column and paste the contents over themselves using Edit|Paste
Special|Values
.. sort your data using the used rows in this column as the sort key.

Cheers

--
macropod
[MVP - Microsoft Word]


"EliseT" wrote in message
...
I have a table with hourly values, but need to use them with half an hour
values. Im therefore trying to make the table twice as long, with blanks

in
every second (or the best would be averages in every second) and the

"next"
from the original list as the next entry.



  #3   Report Post  
Posted to microsoft.public.excel.misc
Zygan
 
Posts: n/a
Default insert a blank in every second line of a row


hey EliseT

This should do the trick, just a once of use short macro

Sub line_space_line()
Range("A1").Select
count = 0
Do Until count = 20
ActiveCell.Offset(1, 0).Select

ActiveCell.EntireRow.Select
Selection.Insert Shift:=xlDown
ActiveCell.Offset(1, 0).Select
count = count + 1
Loop


End Sub

Change the first line "Range("A1").Select" to the correct column e.g a
for a etc

If you only want it to happen for 20 rows input "Do Until count = 20"

if it is never ending rows just use this code exactly the same but will
do the whole column until and empty cell

Sub line_space_line()
Range("A1").Select

Do Until ActiveCell = 0
ActiveCell.Offset(1, 0).Select

ActiveCell.EntireRow.Select
Selection.Insert Shift:=xlDown
ActiveCell.Offset(1, 0).Select

Loop


End Sub


hope it helps


zygan


--
Zygan
------------------------------------------------------------------------
Zygan's Profile: http://www.excelforum.com/member.php...o&userid=34423
View this thread: http://www.excelforum.com/showthread...hreadid=548526

  #4   Report Post  
Posted to microsoft.public.excel.misc
EliseT
 
Posts: n/a
Default insert a blank in every second line of a row

ive now tried that, but i didnt quite get how i was supposed to sort the
data....

"macropod" wrote:

Hi Elise,

You could do this with a macro, but for a one-off that's more complicated
than necessary.

Suggested solution:
.. in an empty column on row 1, enter the formula:
=ROW()*2-1
.. copy this down to your last row.
..below you last row, insert the formula:
=A1+1
replacing 'A' with your column letter.
.. copy this formula down for as many rows as you did with the first formula
(hint: the last # should be one more than was calculated with the first
formula
.. copy this column and paste the contents over themselves using Edit|Paste
Special|Values
.. sort your data using the used rows in this column as the sort key.

Cheers

--
macropod
[MVP - Microsoft Word]


"EliseT" wrote in message
...
I have a table with hourly values, but need to use them with half an hour
values. Im therefore trying to make the table twice as long, with blanks

in
every second (or the best would be averages in every second) and the

"next"
from the original list as the next entry.




  #5   Report Post  
Posted to microsoft.public.excel.misc
EliseT
 
Posts: n/a
Default insert a blank in every second line of a row

thanks a lot! this is the first macro i've ever used in my life...
Elise

"Zygan" wrote:


hey EliseT

This should do the trick, just a once of use short macro

Sub line_space_line()
Range("A1").Select
count = 0
Do Until count = 20
ActiveCell.Offset(1, 0).Select

ActiveCell.EntireRow.Select
Selection.Insert Shift:=xlDown
ActiveCell.Offset(1, 0).Select
count = count + 1
Loop


End Sub

Change the first line "Range("A1").Select" to the correct column e.g a
for a etc

If you only want it to happen for 20 rows input "Do Until count = 20"

if it is never ending rows just use this code exactly the same but will
do the whole column until and empty cell

Sub line_space_line()
Range("A1").Select

Do Until ActiveCell = 0
ActiveCell.Offset(1, 0).Select

ActiveCell.EntireRow.Select
Selection.Insert Shift:=xlDown
ActiveCell.Offset(1, 0).Select

Loop


End Sub


hope it helps


zygan


--
Zygan
------------------------------------------------------------------------
Zygan's Profile: http://www.excelforum.com/member.php...o&userid=34423
View this thread: http://www.excelforum.com/showthread...hreadid=548526




  #6   Report Post  
Posted to microsoft.public.excel.misc
macropod
 
Posts: n/a
Default insert a blank in every second line of a row

Hi Elise,

The idea is to select all the rows & columns with your data, plus the added
one, then sort on the added column. But it looks like you don't need this
now ...

Cheers

--
macropod
[MVP - Microsoft Word]


"EliseT" wrote in message
...
ive now tried that, but i didnt quite get how i was supposed to sort the
data....

"macropod" wrote:

Hi Elise,

You could do this with a macro, but for a one-off that's more

complicated
than necessary.

Suggested solution:
.. in an empty column on row 1, enter the formula:
=ROW()*2-1
.. copy this down to your last row.
..below you last row, insert the formula:
=A1+1
replacing 'A' with your column letter.
.. copy this formula down for as many rows as you did with the first

formula
(hint: the last # should be one more than was calculated with the first
formula
.. copy this column and paste the contents over themselves using

Edit|Paste
Special|Values
.. sort your data using the used rows in this column as the sort key.

Cheers

--
macropod
[MVP - Microsoft Word]


"EliseT" wrote in message
...
I have a table with hourly values, but need to use them with half an

hour
values. Im therefore trying to make the table twice as long, with

blanks
in
every second (or the best would be averages in every second) and the

"next"
from the original list as the next entry.






  #7   Report Post  
Posted to microsoft.public.excel.misc
EliseT
 
Posts: n/a
Default insert a blank in every second line of a row

youre right; but thanks a lot anyway...


"macropod" wrote:

Hi Elise,

The idea is to select all the rows & columns with your data, plus the added
one, then sort on the added column. But it looks like you don't need this
now ...

Cheers

--
macropod
[MVP - Microsoft Word]


"EliseT" wrote in message
...
ive now tried that, but i didnt quite get how i was supposed to sort the
data....

"macropod" wrote:

Hi Elise,

You could do this with a macro, but for a one-off that's more

complicated
than necessary.

Suggested solution:
.. in an empty column on row 1, enter the formula:
=ROW()*2-1
.. copy this down to your last row.
..below you last row, insert the formula:
=A1+1
replacing 'A' with your column letter.
.. copy this formula down for as many rows as you did with the first

formula
(hint: the last # should be one more than was calculated with the first
formula
.. copy this column and paste the contents over themselves using

Edit|Paste
Special|Values
.. sort your data using the used rows in this column as the sort key.

Cheers

--
macropod
[MVP - Microsoft Word]


"EliseT" wrote in message
...
I have a table with hourly values, but need to use them with half an

hour
values. Im therefore trying to make the table twice as long, with

blanks
in
every second (or the best would be averages in every second) and the
"next"
from the original list as the next entry.






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
automatically insert 8 blank rows between each record Evad Excel Discussion (Misc queries) 1 February 2nd 06 04:35 AM
Adding a Blank Line with Change in Name RS Excel Discussion (Misc queries) 3 January 19th 06 12:59 AM
How do I insert manual line breaks in excel? sldwrks84 Excel Worksheet Functions 2 January 12th 06 04:49 PM
Macro to insert blank lines Terry Pinnell Excel Discussion (Misc queries) 6 October 21st 05 11:21 PM
How do I insert a line into a footer? Enter doesn't work. vungher Excel Discussion (Misc queries) 1 August 22nd 05 10:18 AM


All times are GMT +1. The time now is 11:19 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"