#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default **macros**

I need to know if there is any way that some empty spaces copy the text above
it, the problem is that the spaces change from 2 to 8, like this
085800 47
54
085805 47
54
57
58
086335 47
and i need to copy the text above it something like..
085800 47
085800 54
085805 47
085805 54
085805 57
085805 58
086335 47
I really appreciate your time to answer my question and please if there is
any way let me know, because the spreadsheet if too long to do one by one


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default **macros**

Try this small macro:

Sub copy_down()
Dim r As Range, rr As Range, n As Long
With ActiveSheet.UsedRange
n = .Rows.Count + .Row - 1
End With

Set r = Range(Cells(1, "A"), Cells(n, "A")).SpecialCells(xlCellTypeBlanks)

For Each rr In r
rr.FillDown
Next
End Sub

--
Gary''s Student - gsnu200790


"f_pamela" wrote:

I need to know if there is any way that some empty spaces copy the text above
it, the problem is that the spaces change from 2 to 8, like this
085800 47
54
085805 47
54
57
58
086335 47
and i need to copy the text above it something like..
085800 47
085800 54
085805 47
085805 54
085805 57
085805 58
086335 47
I really appreciate your time to answer my question and please if there is
any way let me know, because the spreadsheet if too long to do one by one


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,549
Default **macros**


John Walkenbach shows a way here (with pictures)...
http://j-walk.com/ss/excel/usertips/tip040.htm
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




"f_pamela"
wrote in message
I need to know if there is any way that some empty spaces copy the text above
it, the problem is that the spaces change from 2 to 8, like this
085800 47
54
085805 47
54
57
58
086335 47
and i need to copy the text above it something like..
085800 47
085800 54
085805 47
085805 54
085805 57
085805 58
086335 47
I really appreciate your time to answer my question and please if there is
any way let me know, because the spreadsheet if too long to do one by one


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 55
Default **macros**

Hi,

You can also use a formula to get the data as you want (I assume your data
is in a pivot table?)

Assuming the data you have is in Column A and B (with the first piece of
data at row 2) then you could use the following formulas:
In column C use the formula
=if(isblank(A2),C1,A2)
In column D use the formula
=if(isblank(B2),D1,B2)

Then you just need to copy to the end of your data table.
I use this formula all the time with the data I get from pivot tables.

Goodluck with which ever method you use.


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default **macros**

Thank you very much, have a great day!

"Gary''s Student" wrote:

Try this small macro:

Sub copy_down()
Dim r As Range, rr As Range, n As Long
With ActiveSheet.UsedRange
n = .Rows.Count + .Row - 1
End With

Set r = Range(Cells(1, "A"), Cells(n, "A")).SpecialCells(xlCellTypeBlanks)

For Each rr In r
rr.FillDown
Next
End Sub

--
Gary''s Student - gsnu200790


"f_pamela" wrote:

I need to know if there is any way that some empty spaces copy the text above
it, the problem is that the spaces change from 2 to 8, like this
085800 47
54
085805 47
54
57
58
086335 47
and i need to copy the text above it something like..
085800 47
085800 54
085805 47
085805 54
085805 57
085805 58
086335 47
I really appreciate your time to answer my question and please if there is
any way let me know, because the spreadsheet if too long to do one by one




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default **macros**

You don't need a macro.

Select column A or whichever column............

F5SpecialBlanksOK

Type an = sign in the active cell and point to cell above.

Hit CTRL + Enter to fill.


Gord Dibben MS Excel MVP

On Wed, 4 Jun 2008 18:24:01 -0700, f_pamela
wrote:

I need to know if there is any way that some empty spaces copy the text above
it, the problem is that the spaces change from 2 to 8, like this
085800 47
54
085805 47
54
57
58
086335 47
and i need to copy the text above it something like..
085800 47
085800 54
085805 47
085805 54
085805 57
085805 58
086335 47
I really appreciate your time to answer my question and please if there is
any way let me know, because the spreadsheet if too long to do one by one


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
Excel 2007 macros - how to merge 5 macros together into one Sue Excel Discussion (Misc queries) 1 April 16th 08 08:36 PM
Macros warning always shows up, even if all macros removed Joe M Excel Discussion (Misc queries) 1 December 20th 07 04:45 AM
Macros - copying macros from one computer to another TT Excel Discussion (Misc queries) 18 December 14th 06 03:24 AM
"openinf file..."ENABLE MACROS...DISABLE MACROS" F. Lawrence Kulchar Excel Discussion (Misc queries) 3 September 12th 06 10:33 AM
Training: More on how to use macros in Excel: Recording Macros ToriT Excel Worksheet Functions 2 February 10th 06 07:05 PM


All times are GMT +1. The time now is 02:14 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"