ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Self creating formulas (https://www.excelbanter.com/excel-programming/347851-self-creating-formulas.html)

Antonov

Self creating formulas
 
Hello everybody:
is it possible to have a macro or whatever to "replicate" the formulas in
the next row so that I have the formulas only in the cells I am actually
going to use and not on all the empty rows?



Tom Ogilvy

Self creating formulas
 
Dim rng as Range
ActiveCell.EntireRow.FillDown
On error resume Next
set rng = ActiveCell.EntireRow.SpecialCells(xlConstants)
On Error goto 0
if not rng is nothing then
rng.ClearContents
End if

--
Regards,
Tom Ogilvy


"antonov" wrote in message
...
Hello everybody:
is it possible to have a macro or whatever to "replicate" the formulas in
the next row so that I have the formulas only in the cells I am actually
going to use and not on all the empty rows?





Antonov

Self creating formulas
 
Tom, thanks for the hint...
I've created a macro with the code you gave but when I run it it cancels all
formulas from the first row (the first row contains 54 cells, 16 of which
with formulas)
"Tom Ogilvy" wrote in message
...
Dim rng as Range
ActiveCell.EntireRow.FillDown
On error resume Next
set rng = ActiveCell.EntireRow.SpecialCells(xlConstants)
On Error goto 0
if not rng is nothing then
rng.ClearContents
End if

--
Regards,
Tom Ogilvy


"antonov" wrote in message
...
Hello everybody:
is it possible to have a macro or whatever to "replicate" the formulas in
the next row so that I have the formulas only in the cells I am actually
going to use and not on all the empty rows?







Antonov

Self creating formulas
 
Tom, problem solved. I had a formula in cell A2 which I did forget about.
Your code now works perfectly... Thank you very very much again
"antonov" wrote in message
...
Hello everybody:
is it possible to have a macro or whatever to "replicate" the formulas in
the next row so that I have the formulas only in the cells I am actually
going to use and not on all the empty rows?





Tom Ogilvy

Self creating formulas
 
With a cell in row 2 selected, the code ran fine for me as expected.

--
Regards,
Tom Ogilvy


"antonov" wrote in message
...
Tom, thanks for the hint...
I've created a macro with the code you gave but when I run it it cancels

all
formulas from the first row (the first row contains 54 cells, 16 of which
with formulas)
"Tom Ogilvy" wrote in message
...
Dim rng as Range
ActiveCell.EntireRow.FillDown
On error resume Next
set rng = ActiveCell.EntireRow.SpecialCells(xlConstants)
On Error goto 0
if not rng is nothing then
rng.ClearContents
End if

--
Regards,
Tom Ogilvy


"antonov" wrote in message
...
Hello everybody:
is it possible to have a macro or whatever to "replicate" the formulas

in
the next row so that I have the formulas only in the cells I am

actually
going to use and not on all the empty rows?










All times are GMT +1. The time now is 04:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com