View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
RAHokie RAHokie is offline
external usenet poster
 
Posts: 4
Default End(xlDown) not working?

I am using the following code to select a variable range of cells in a column
for formatting.
ExcelSheet.Application.Range("B12").Select
ExcelSheet.Application.Range(Selection, Selection.End(xlDown)).Select
With ExcelSheet.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
I get a message that says "Object variable or with block variable not set."
I suspect that my syntax may be slightly off somewhere. Any suggestions?