Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Fill down for all the cells

Hi

Is there any way to fill down all the cells through macro only for filled
cells?

Simple Example

I have ten number in column A and same in column B in Column C i need sum of
both the columns. column D multiplication.

For auto fill am using the below code apart from formula in cell C.
c=2
while range("A" & c).value < ""
range("C" & c).select
selection.filldown
c=c+1
wend

For D column I have to write the same code again. and if i have lots of
formulas in different columns the same thing continues.

Any solution.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 419
Default Fill down for all the cells

singh,

if you have a number in every single cell in column B down to the last row
of your data, select C1:D1 (or C2:D2 if your data starts in row 2) and
double-click the fill handle.

HTH,

Conan




"singh" wrote in message
...
Hi

Is there any way to fill down all the cells through macro only for filled
cells?

Simple Example

I have ten number in column A and same in column B in Column C i need sum
of
both the columns. column D multiplication.

For auto fill am using the below code apart from formula in cell C.
c=2
while range("A" & c).value < ""
range("C" & c).select
selection.filldown
c=c+1
wend

For D column I have to write the same code again. and if i have lots of
formulas in different columns the same thing continues.

Any solution.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Fill down for all the cells

This thing is really working. Thanks

Can we do for next sheet also?

I need some calculation in sheet2 using data in sheet1. I do not think
autofill will work in this case.. Is there any way we can resolve it?

"INTP56" wrote:

'Try this

Public Sub TestFillDown()
Dim rngCurrent As Range
'I'm assuming the first value of interest is in .Cells(1,1)
With ThisWorkbook.Worksheets(1)
Set rngCurrent = .Range(.Cells(1, 1), .Cells(1, 1).End(xlDown))
rngCurrent.Offset(0, 2).FormulaR1C1 = "=RC[-2]+RC[-1]"
rngCurrent.Offset(0, 3).FormulaR1C1 = "=RC[-2]*RC[-1]"
End With
End Sub

Bob

"singh" wrote:

Hi

Is there any way to fill down all the cells through macro only for filled
cells?

Simple Example

I have ten number in column A and same in column B in Column C i need sum of
both the columns. column D multiplication.

For auto fill am using the below code apart from formula in cell C.
c=2
while range("A" & c).value < ""
range("C" & c).select
selection.filldown
c=c+1
wend

For D column I have to write the same code again. and if i have lots of
formulas in different columns the same thing continues.

Any solution.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Fill down for all the cells

Hi Kelly

Really very simple answer. But i can not use mouse while running the macro
to fill down by double click. In case I have to copy those data and paste it
somwhere then my entire macro is gone.

"Conan Kelly" wrote:

singh,

if you have a number in every single cell in column B down to the last row
of your data, select C1:D1 (or C2:D2 if your data starts in row 2) and
double-click the fill handle.

HTH,

Conan




"singh" wrote in message
...
Hi

Is there any way to fill down all the cells through macro only for filled
cells?

Simple Example

I have ten number in column A and same in column B in Column C i need sum
of
both the columns. column D multiplication.

For auto fill am using the below code apart from formula in cell C.
c=2
while range("A" & c).value < ""
range("C" & c).select
selection.filldown
c=c+1
wend

For D column I have to write the same code again. and if i have lots of
formulas in different columns the same thing continues.

Any solution.





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
Fill Cells Based On Cells In Another Sheet [email protected] Excel Worksheet Functions 1 May 31st 07 10:30 PM
Fill cells with color based on criteria in two cells AA Excel Worksheet Functions 2 January 2nd 06 11:29 PM
How do I fill (copy) nonadjacent cells to adjacent cells? BuckyGeorge Excel Discussion (Misc queries) 2 December 22nd 05 04:18 AM
create a fill in template to tab to fill in cells Excel-erator Excel Discussion (Misc queries) 2 July 6th 05 09:57 PM
HOW TO FORMATE CELLS TO COUNT CELLS WITH A FILL COLOR? Moore New Users to Excel 1 June 15th 05 06:41 PM


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

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"