Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default Copy Fomulas down

I have data in columns A:E and corresponding formulas in F:G. Data is added
to columns A:E and I am trying to create a formula that will find the last
formula(s) in columns F:G and copy it down to the end of the data.

I have found numours ways to do this using a static reference in F & G, but
I have to use the last formula in the column to copy down.

Any help is appreciated.

Ronbo
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Copy Fomulas down

hi
formulas return values, they cannot perform actions like copy and paste. you
will have to do this manuallly or via macro.

Regards
FSt1

"Ronbo" wrote:

I have data in columns A:E and corresponding formulas in F:G. Data is added
to columns A:E and I am trying to create a formula that will find the last
formula(s) in columns F:G and copy it down to the end of the data.

I have found numours ways to do this using a static reference in F & G, but
I have to use the last formula in the column to copy down.

Any help is appreciated.

Ronbo

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default Copy Fomulas down

P.S. I am trying to create a routine/macro, not a formula.

"Ronbo" wrote:

I have data in columns A:E and corresponding formulas in F:G. Data is added
to columns A:E and I am trying to create a formula that will find the last
formula(s) in columns F:G and copy it down to the end of the data.

I have found numours ways to do this using a static reference in F & G, but
I have to use the last formula in the column to copy down.

Any help is appreciated.

Ronbo

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Copy Fomulas down

Sub copyformulas()

LastRow = Range("A" & Rows.Count).End(xlUp).Row
LastRowF = 0
LastRowG = 0
For RowCount = 1 To LastRow

If Left(Range("F" & RowCount).Formula, 1) = "=" Then
LastRowF = RowCount
End If
If Left(Range("G" & RowCount).Formula, 1) = "=" Then
LastRowG = RowCount
End If

Next RowCount

Range("F" & LastRowF).Copy _
Destination:=Range("F" & (LastRowF + 1) & ":F" & _
LastRow)
Range("G" & LastRowG).Copy _
Destination:=Range("G" & (LastRowG + 1) & ":G" & _
LastRow)
End Sub

"Ronbo" wrote:

I have data in columns A:E and corresponding formulas in F:G. Data is added
to columns A:E and I am trying to create a formula that will find the last
formula(s) in columns F:G and copy it down to the end of the data.

I have found numours ways to do this using a static reference in F & G, but
I have to use the last formula in the column to copy down.

Any help is appreciated.

Ronbo

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default Copy Fomulas down

Perfect! Thanks a lot.

"Joel" wrote:

Sub copyformulas()

LastRow = Range("A" & Rows.Count).End(xlUp).Row
LastRowF = 0
LastRowG = 0
For RowCount = 1 To LastRow

If Left(Range("F" & RowCount).Formula, 1) = "=" Then
LastRowF = RowCount
End If
If Left(Range("G" & RowCount).Formula, 1) = "=" Then
LastRowG = RowCount
End If

Next RowCount

Range("F" & LastRowF).Copy _
Destination:=Range("F" & (LastRowF + 1) & ":F" & _
LastRow)
Range("G" & LastRowG).Copy _
Destination:=Range("G" & (LastRowG + 1) & ":G" & _
LastRow)
End Sub

"Ronbo" wrote:

I have data in columns A:E and corresponding formulas in F:G. Data is added
to columns A:E and I am trying to create a formula that will find the last
formula(s) in columns F:G and copy it down to the end of the data.

I have found numours ways to do this using a static reference in F & G, but
I have to use the last formula in the column to copy down.

Any help is appreciated.

Ronbo



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Copy Fomulas down

Sub Auto_Fill()
Dim Elastrow As Long
Dim Flastrow As Long
With ActiveSheet
Flastrow = Range("F" & Rows.Count).End(xlUp).Row
Elastrow = Range("E" & Rows.Count).End(xlUp).Row
Range("F" & Flastrow & ":G" & Elastrow).FillDown
End With
End Sub


Gord Dibben MS Excel MVP

On Sat, 28 Jun 2008 10:08:00 -0700, Ronbo
wrote:

I have data in columns A:E and corresponding formulas in F:G. Data is added
to columns A:E and I am trying to create a formula that will find the last
formula(s) in columns F:G and copy it down to the end of the data.

I have found numours ways to do this using a static reference in F & G, but
I have to use the last formula in the column to copy down.

Any help is appreciated.

Ronbo


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
Locking Fomulas Rahn New Users to Excel 2 April 13th 10 07:49 PM
Cell fomulas less than or = to solar mike Excel Discussion (Misc queries) 1 September 2nd 09 09:37 PM
Adding $ to fomulas Neil Boycott Excel Discussion (Misc queries) 2 October 14th 08 12:08 PM
swapping fomulas for values tantrum9 Excel Discussion (Misc queries) 1 April 11th 07 01:49 AM
creating fomulas in excel fathead Excel Worksheet Functions 2 February 2nd 05 11:05 AM


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