Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
v3?
Dim cStartRow As Long Dim cEndRow As Long Dim cRow As Long Dim pzValue cStartRow = 17 cEndRow = Cells(Rows.Count, "C").End(xlUp).Row pzValue = Cells(cStartRow, "C").Formula cStartRow = cStartRow + 1 Do Cells(cStartRow, "C").Formula = pzValue cRow = Cells(cStartRow, "C").End(xlDown).Row If cRow <= cEndRow Then Cells(cStartRow, "C").AutoFill _ Destination:=Range(Cells(cStartRow, "C"), Cells(cRow - 1, "C")), _ Type:=xlFillCopy End If cStartRow = cRow Do cStartRow = cStartRow + 1 Loop Until Cells(cStartRow, "C") = "" Or cStartRow = cEndRow Loop Until cStartRow = cEndRow -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Vliegveld " wrote in message ... Thank you very much Bob, this script is working, and copy's all the cell values. But the problem is it writes over cells that already have a value. I would be great if the script stops when he finds a cell with a new value, and then continue filling the cells under it with that new value. And so on. Dont know if this is possible, but it would make my day. (17000 cells to do times 3 coloms) --- Message posted from http://www.ExcelForum.com/ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for the new script,
Unfortunately this one also doesnt stop when a cell in the same colom has a new value, it just continues autofill with the first value. --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Not for me it doesn't, give me an example of data where it goes wrong, what
values in what rows. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Vliegveld " wrote in message ... Thanks for the new script, Unfortunately this one also doesnt stop when a cell in the same colom has a new value, it just continues autofill with the first value. --- Message posted from http://www.ExcelForum.com/ |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Think I may have slightly misunderstood the brief.
See if this version does what you want Dim cStartRow As Long Dim cEndRow As Long Dim cRow As Long Dim pzValue cStartRow = 17 cEndRow = Cells(Rows.Count, "C").End(xlUp).Row pzValue = Cells(cStartRow, "C").Formula 'cStartRow = cStartRow + 1 Do Cells(cStartRow, "C").Formula = pzValue cRow = Cells(cStartRow, "C").End(xlDown).Row If cRow <= cEndRow Then Cells(cStartRow, "C").AutoFill _ Destination:=Range(Cells(cStartRow, "C"), Cells(cRow - 1, "C")), _ Type:=xlFillCopy End If cStartRow = cRow Do Until Cells(cStartRow + 1, "C") = "" Or cStartRow + 1 = cEndRow cStartRow = cStartRow + 1 Loop pzValue = Cells(cStartRow, "C").Formula Loop Until cStartRow = cEndRow -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Bob Phillips" wrote in message ... Not for me it doesn't, give me an example of data where it goes wrong, what values in what rows. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Vliegveld " wrote in message ... Thanks for the new script, Unfortunately this one also doesnt stop when a cell in the same colom has a new value, it just continues autofill with the first value. --- Message posted from http://www.ExcelForum.com/ |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
For example I have:
In cell c17: NC0101 Then in cell c19: NC0102 Then in cell c200: NC0103 It only uses the value of c17 and autofills it to 1600 -- Message posted from http://www.ExcelForum.com |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Have you looked at my follow-up post yet?
-- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Vliegveld " wrote in message ... For example I have: In cell c17: NC0101 Then in cell c19: NC0102 Then in cell c200: NC0103 It only uses the value of c17 and autofills it to 16000 --- Message posted from http://www.ExcelForum.com/ |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Or course it can, send me your workbook direct. Watch the spam filter in the
email address. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Vliegveld " wrote in message ... Maybe this cannot be done with a script? --- Message posted from http://www.ExcelForum.com/ |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry Bob, oversaw that post.
I tried it, but strange enough, it works only untill the first change in cells. So c17 until c22 It autofils the value from c17, then it takes the new value from c22 and autofills it to the end (overwriting all the other values, eg c2003 etc.) --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
simple question on formulas and autofil | Excel Worksheet Functions | |||
question about some excel restriction script running on ... | Excel Discussion (Misc queries) | |||
question about some excel restriction script running on ... | Excel Discussion (Misc queries) | |||
Autofil a cell in the same row. | Excel Worksheet Functions | |||
Filling cells (autofil?) in Excel 2003 | Excel Discussion (Misc queries) |