ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Creating cell ranges (https://www.excelbanter.com/excel-programming/361258-creating-cell-ranges.html)

Neal

Creating cell ranges
 
How would I go about writing code to select a column of cells to work on but
let work as long as data is present to the right of it ? If c1 is blank stop
running,I would like to have an open range instead of H2 to H167, I would
like it to be H2 to the next cell that isnt blank! Is it possible? Any help
would be greatly appreciated, Neal.

Range("H2").Select
Selection.AutoFill Destination:=Range("H2:H167"), Type:=xlFillDefault
Range("H2:H167").Select
ActiveWindow.SmallScroll Down:=-159
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False


All times are GMT +1. The time now is 01:14 AM.

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