Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Wonder if someone can help me please. I have an excel spreadsheet where the may be data missing from some of the cells within a row. Could anyone tell me how I would create a macro to find these blank cells (obviously I would need to be able to determine the columns that are pertinent) and copy the cells from above row. Many thanks in advance Chris |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can use code or do it manually. (I find doing it manually is quicker!)
Debra Dalgleish has suggestions for both: http://www.contextures.com/xlDataEntry02.html ir26121973 wrote: Hi, Wonder if someone can help me please. I have an excel spreadsheet where the may be data missing from some of the cells within a row. Could anyone tell me how I would create a macro to find these blank cells (obviously I would need to be able to determine the columns that are pertinent) and copy the cells from above row. Many thanks in advance Chris -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi dave,
Yes i understand wher you are coming from. Unfortunately I aerage on having to go through about 25000 rows of data, so in this instance i think a macro would be better. Regards Chris "Dave Peterson" wrote: You can use code or do it manually. (I find doing it manually is quicker!) Debra Dalgleish has suggestions for both: http://www.contextures.com/xlDataEntry02.html ir26121973 wrote: Hi, Wonder if someone can help me please. I have an excel spreadsheet where the may be data missing from some of the cells within a row. Could anyone tell me how I would create a macro to find these blank cells (obviously I would need to be able to determine the columns that are pertinent) and copy the cells from above row. Many thanks in advance Chris -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There's code at that link, too.
ir26121973 wrote: Hi dave, Yes i understand wher you are coming from. Unfortunately I aerage on having to go through about 25000 rows of data, so in this instance i think a macro would be better. Regards Chris "Dave Peterson" wrote: You can use code or do it manually. (I find doing it manually is quicker!) Debra Dalgleish has suggestions for both: http://www.contextures.com/xlDataEntry02.html ir26121973 wrote: Hi, Wonder if someone can help me please. I have an excel spreadsheet where the may be data missing from some of the cells within a row. Could anyone tell me how I would create a macro to find these blank cells (obviously I would need to be able to determine the columns that are pertinent) and copy the cells from above row. Many thanks in advance Chris -- Dave Peterson -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Dave,
Thanks for the link to the code. Can you tell me please, how could I adapt this to copy rows rather than columns? Many thanks Chris "Dave Peterson" wrote: There's code at that link, too. ir26121973 wrote: Hi dave, Yes i understand wher you are coming from. Unfortunately I aerage on having to go through about 25000 rows of data, so in this instance i think a macro would be better. Regards Chris "Dave Peterson" wrote: You can use code or do it manually. (I find doing it manually is quicker!) Debra Dalgleish has suggestions for both: http://www.contextures.com/xlDataEntry02.html ir26121973 wrote: Hi, Wonder if someone can help me please. I have an excel spreadsheet where the may be data missing from some of the cells within a row. Could anyone tell me how I would create a macro to find these blank cells (obviously I would need to be able to determine the columns that are pertinent) and copy the cells from above row. Many thanks in advance Chris -- Dave Peterson -- Dave Peterson |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Does this mean you want to fill the empty cells with values to the left?
If you really mean that, then: Option Explicit Sub FillRowsBlanks() Dim wks As Worksheet Dim rng As Range Dim LastCol As Long Dim myRow As Long Set wks = ActiveSheet With wks myRow = ActiveCell.Row Set rng = .UsedRange 'try to reset the lastcell LastCol = .Cells.SpecialCells(xlCellTypeLastCell).Column Set rng = Nothing On Error Resume Next Set rng = .Range(.Cells(myRow, 2), .Cells(myRow, LastCol)) _ .Cells.SpecialCells(xlCellTypeBlanks) On Error GoTo 0 If rng Is Nothing Then MsgBox "No blanks found" Exit Sub Else rng.FormulaR1C1 = "=RC[-1]" End If 'replace formulas with values With .Cells(myRow, 1).EntireRow .Value = .Value End With End With End Sub ir26121973 wrote: Hi Dave, Thanks for the link to the code. Can you tell me please, how could I adapt this to copy rows rather than columns? Many thanks Chris "Dave Peterson" wrote: There's code at that link, too. ir26121973 wrote: Hi dave, Yes i understand wher you are coming from. Unfortunately I aerage on having to go through about 25000 rows of data, so in this instance i think a macro would be better. Regards Chris "Dave Peterson" wrote: You can use code or do it manually. (I find doing it manually is quicker!) Debra Dalgleish has suggestions for both: http://www.contextures.com/xlDataEntry02.html ir26121973 wrote: Hi, Wonder if someone can help me please. I have an excel spreadsheet where the may be data missing from some of the cells within a row. Could anyone tell me how I would create a macro to find these blank cells (obviously I would need to be able to determine the columns that are pertinent) and copy the cells from above row. Many thanks in advance Chris -- Dave Peterson -- Dave Peterson -- Dave Peterson |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
ps.
I still think that doing it manually (even with 25000 rows) would be quicker. I think I'd only use the macro if I were mechanizing a larger procedure and this was just one of the steps. ir26121973 wrote: Hi dave, Yes i understand wher you are coming from. Unfortunately I aerage on having to go through about 25000 rows of data, so in this instance i think a macro would be better. Regards Chris "Dave Peterson" wrote: You can use code or do it manually. (I find doing it manually is quicker!) Debra Dalgleish has suggestions for both: http://www.contextures.com/xlDataEntry02.html ir26121973 wrote: Hi, Wonder if someone can help me please. I have an excel spreadsheet where the may be data missing from some of the cells within a row. Could anyone tell me how I would create a macro to find these blank cells (obviously I would need to be able to determine the columns that are pertinent) and copy the cells from above row. Many thanks in advance Chris -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How copy none excel data & paste in 2007 without overwriting data | Excel Discussion (Misc queries) | |||
filted data, copy and paste a col. puts data in wrong row how fix | New Users to Excel | |||
Retrieve multiple data rows data from a very long list and copy t | Excel Discussion (Misc queries) | |||
How do I copy data from main frame computer and keep data in cell | Excel Worksheet Functions | |||
Copy data into cells until changes trigger new copy | Excel Programming |