LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Excel VBA question - Running a autofil

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/



 
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
simple question on formulas and autofil R1CHO Excel Worksheet Functions 1 April 1st 08 01:23 AM
question about some excel restriction script running on ... roise_r Excel Discussion (Misc queries) 0 March 30th 06 11:53 AM
question about some excel restriction script running on ... roise_r Excel Discussion (Misc queries) 0 March 30th 06 11:44 AM
Autofil a cell in the same row. Mac5 Excel Worksheet Functions 3 October 1st 05 12:34 AM
Filling cells (autofil?) in Excel 2003 Hnelg Excel Discussion (Misc queries) 3 July 5th 05 02:47 PM


All times are GMT +1. The time now is 01:52 PM.

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"