Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default fill in empty cells beneath filled ones

Hello,

I'm not a programmer, but often can make things work my own way...
except for now.
At "http://users.telenet.be/coppenskurt/help/sinter.xlsm" you can find
my problemchild (Office2007 with macro). At the opened sheet, I create
some numbers as you can see by clicking the "Test"-button. Where they
come from and wath they mean isn't important, but I just added the
file so you could understand what I'm talking about.
What I'm trying to do now is:
-fill in the empty cells (I colored them yellow so you could know
which ones I mean) with the last number above (in this case always
0.65)
-make the product of the complete row in the first column (this is the
easy part :))

I have tried everything and searched Google for hours but haven't
found anything working :(
Can someone give me a hand?

Thanks in advance!

Kurt
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 533
Default fill in empty cells beneath filled ones

I couldn't come up with anything elegant so I settled for something that
works.

Sub a()
Dim SrcRg As Range, FirstRg As Range
Dim LastRg As Range, FillCell As Range
Dim Counter As Integer
Set SrcRg = Range("B1").CurrentRegion.SpecialCells(xlCellTypeC onstants)
Set FirstRg = SrcRg.Areas(1)
Set LastRg = SrcRg.Areas(SrcRg.Areas.Count)
For Counter = 1 To SrcRg.Areas.Count - 1
Set FillCell = SrcRg.Areas(Counter).Cells(2)
FillCell.Resize(LastRg.Row - FillCell.Row + 2).FillDown
Next
End Sub

--
Jim
"Kurt" wrote in message
...
Hello,

I'm not a programmer, but often can make things work my own way...
except for now.
At "http://users.telenet.be/coppenskurt/help/sinter.xlsm" you can find
my problemchild (Office2007 with macro). At the opened sheet, I create
some numbers as you can see by clicking the "Test"-button. Where they
come from and wath they mean isn't important, but I just added the
file so you could understand what I'm talking about.
What I'm trying to do now is:
-fill in the empty cells (I colored them yellow so you could know
which ones I mean) with the last number above (in this case always
0.65)
-make the product of the complete row in the first column (this is the
easy part :))

I have tried everything and searched Google for hours but haven't
found anything working :(
Can someone give me a hand?

Thanks in advance!

Kurt



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default fill in empty cells beneath filled ones

Thanks!
It does work!
But I don't get it why it changes the values in the C-column when you
run it more than once... If you could run it more than once, without
messing up values, I could put it in the original macro so it does
everything with one click.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default fill in empty cells beneath filled ones

On 24 nov, 11:23, Kurt wrote:
Thanks!
It does work!
But I don't get it why it changes the values in the C-column when you
run it more than once... If you could run it more than once, without
messing up values, I could put it in the original macro so it does
everything with one click.


I kept trying and added the following part to my original macro:

i = 3
Do Until Range(Cells(i, 3), Cells(i, 3)) = ""
Range(Cells(i, 2), Cells(i, 2)).Value = Range(Cells(i - 1, 2),
Cells(i - 1, 2)).Value
i = i + 1
Loop
Sheets("grafiek").Select

It now fills in the empty cells when they are firts created!
Thanks for all the help!
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
Excel counting empty cells until first filled one Rafael Martinez Excel Discussion (Misc queries) 2 September 17th 09 05:20 PM
Excel- find the last filled cells in column with empty cells [email protected] Excel Programming 1 September 28th 07 12:20 AM
Macro Request: Fill in empty cells with previous Filled cell in column Artis Excel Worksheet Functions 2 June 25th 07 08:30 PM
Copy Data From Filled to Empty Cells Sheikh Saadi Excel Discussion (Misc queries) 0 November 10th 05 07:21 PM
What must I do to get gridlines printed for both filled and empty cells? Hubert Earl Excel Programming 1 November 7th 04 08:33 PM


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