ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro help (https://www.excelbanter.com/excel-programming/339419-macro-help.html)

Sean H

Macro help
 
Hi,

I needed help with a macro that can fill the cells beneath it until it
reaches the next entry, then do the same until it reaches the end of the
file. I have researched loops but I haven't figured out how to implement
them with a "fill" command.

Thanks,
Sean Heckathorne

Don Guillett[_4_]

Macro help
 
one way

Sub fillincolumn()
For Each c In Range("a3:a18")
If c = "" Then c.Value = c.Offset(-1)
Next
End Sub

--
Don Guillett
SalesAid Software

"Sean H" wrote in message
...
Hi,

I needed help with a macro that can fill the cells beneath it until it
reaches the next entry, then do the same until it reaches the end of the
file. I have researched loops but I haven't figured out how to implement
them with a "fill" command.

Thanks,
Sean Heckathorne




Jef Gorbach

Macro help
 

"Sean H" wrote in message
...
Hi,

I needed help with a macro that can fill the cells beneath it until it
reaches the next entry, then do the same until it reaches the end of the
file. I have researched loops but I haven't figured out how to implement
them with a "fill" command.

Thanks,
Sean Heckathorne


The fastest way i know of presuming your trying to fill blank cells with a
given value is:
Range(start,end).SpecialCells(xlBlanks).Value = your value

Otherwise u need to grind thru each cell in the range,
For rowindex = 2 to range("A65536").end(xlup).row
if range("A"&rowindex).value = your_test_value then
range("A"&rowindex).value = your_value
next rowindex




Dave Peterson

Macro help
 
Debra Dalgleish has some techniques at:
http://contextures.com/xlDataEntry02.html

(both manual and by code)

Sean H wrote:

Hi,

I needed help with a macro that can fill the cells beneath it until it
reaches the next entry, then do the same until it reaches the end of the
file. I have researched loops but I haven't figured out how to implement
them with a "fill" command.

Thanks,
Sean Heckathorne


--

Dave Peterson


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com