Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Copy data from above

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Copy data from above

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Copy data from above

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Copy data from above

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Copy data from above

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Copy data from above

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Copy data from above

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
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
How copy none excel data & paste in 2007 without overwriting data Wakefootin Excel Discussion (Misc queries) 2 October 8th 09 12:15 AM
filted data, copy and paste a col. puts data in wrong row how fix chris_fig New Users to Excel 1 October 16th 06 04:26 PM
Retrieve multiple data rows data from a very long list and copy t mathew Excel Discussion (Misc queries) 1 September 13th 06 08:24 PM
How do I copy data from main frame computer and keep data in cell Doug Excel Worksheet Functions 1 May 30th 06 05:15 PM
Copy data into cells until changes trigger new copy mdeanda Excel Programming 2 April 25th 05 01:32 PM


All times are GMT +1. The time now is 09:33 AM.

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

About Us

"It's about Microsoft Excel"