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

Hi,

I have some code assigned to a button that copies data from one work
sheet to the first blank cells in certain columns in a second
worksheet.

What I now want to do is fill the remainder of this "new" row with the
formulas from the row above for columns G to M.

Anyone have any ideas how to do this.

Many thanks
Simon

Code for copying the data:

Private Sub Copy_Data_Click()

Dim rng As Range, cell As Range
On Error Resume Next
With Worksheets("Data")
Set rng = .Columns(5).SpecialCells(xlBlanks)
End With
On Error GoTo 0
If rng Is Nothing Then Exit Sub
For Each cell In rng
If Application.CountA(cell.Resize(3, 1)) = 0 Then
Worksheets("Welcome").Range("C20").Copy _
Destination:=cell
Exit For
End If
Next

With Worksheets("Data")
Set rng = .Columns(6).SpecialCells(xlBlanks)
End With
On Error GoTo 0
If rng Is Nothing Then Exit Sub
For Each cell In rng
If Application.CountA(cell.Resize(3, 1)) = 0 Then
Worksheets("Welcome").Range("C22").Copy _
Destination:=cell
Exit For
End If
Next

End Sub

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 copy formulas down columns or copy formulas all the HowlingBlue Excel Worksheet Functions 1 March 16th 07 11:11 PM
How do I copy formulas but using the same range each time I copy Laffin Excel Worksheet Functions 2 June 22nd 06 04:17 PM
copy formulas from a contiguous range to a safe place and copy them back later Lucas Budlong Excel Programming 2 February 22nd 06 08:26 PM
copy without formulas pabs[_3_] Excel Programming 8 December 19th 03 02:42 PM
Range COPY function - how to copy VALUES and not formulas James Cooke Excel Programming 1 August 21st 03 07:04 PM


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