Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel counting empty cells until first filled one | Excel Discussion (Misc queries) | |||
Excel- find the last filled cells in column with empty cells | Excel Programming | |||
Macro Request: Fill in empty cells with previous Filled cell in column | Excel Worksheet Functions | |||
Copy Data From Filled to Empty Cells | Excel Discussion (Misc queries) | |||
What must I do to get gridlines printed for both filled and empty cells? | Excel Programming |