View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
galimi[_2_] galimi[_2_] is offline
external usenet poster
 
Posts: 65
Default VBA : Excel Range Selection Problem

I prefer using the UsedRange property to determine the number of rows and
columns being used. Try replacing your first line of code with the following.

Range(cells(7,6),cells(7,usedrange.columns.count)) .select

http://HelpExcel.com

"Learner" wrote:

I am experiencing a unique situation about the Excel Range. This is the
code :


Range(Cells(7, 6), Cells(7, intLastColumn).End(xlDown)).Select
Selection.NumberFormat = "0"

Its working most of the time and changing the format to "0" as desired.
(Columns will contain numerics only) But some times, For some wiered
reason, it wont reach till the last row. Anyone has similar experience.

Appreciate help.