Return Range of Non empty cells of first row

mubi_masti

Registered User.
Local time
Tomorrow, 03:39
Joined
Oct 2, 2011
Messages
46
I am using following code to format the excel sheet from access.

With xlApp
.Application.Sheets(sSheet).Select
.Application.Cells.Select
.Application.Selection.ClearFormats
.Application.Rows("1:1").Select


in first row only five cells have values and instead of selecting whole row i want to apply formatting on only those cells that have values. For this i need to give range to following method. Is it possible excel autometically identify the range and apply formatting.

.Application.Rows("1:1").Select

like following

.Application.Rows("a1:a5").Select
 
What happened when you tried it.?
I suspect that it won't work but try Range rather than Rows, not that I have ever done this.

Brian
 

Users who are viewing this thread

Back
Top Bottom