Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
**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
Posted to microsoft.public.excel.misc
|
|||
|
|||
**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
Posted to microsoft.public.excel.misc
|
|||
|
|||
**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
Posted to microsoft.public.excel.misc
|
|||
|
|||
**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
Posted to microsoft.public.excel.misc
|
|||
|
|||
**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
Posted to microsoft.public.excel.misc
|
|||
|
|||
**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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2007 macros - how to merge 5 macros together into one | Excel Discussion (Misc queries) | |||
Macros warning always shows up, even if all macros removed | Excel Discussion (Misc queries) | |||
Macros - copying macros from one computer to another | Excel Discussion (Misc queries) | |||
"openinf file..."ENABLE MACROS...DISABLE MACROS" | Excel Discussion (Misc queries) | |||
Training: More on how to use macros in Excel: Recording Macros | Excel Worksheet Functions |