View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default impossible syntax??

Dim Target as range

Set Target = Sheets("tele").Range( _
ActiveCell.offset(0,79).Resize(6, 1).Address(0,0))
t=Application.WorksheetFunction.CountA(Target)

might be closer to what the original code shows.

A worksheet does not have an activeCell property
The code is inconclusive on whether Tele is the active sheet
The cells references both add 79 to the activecell column value, so the
column width is 1, not 79 and is thus offset from the activecell


--
Regards,
Tom Ogilvy


RADO wrote in message
...
I would use something like this instead:

Dim Target as range

Set Target = Sheets("tele").ActiveCell.Resize(6, 79)
t=Application.WorksheetFunction. CountA (Target)

Best -

RADO

"CG Rosén" wrote in message
...
Good Day,

Is the following approach a dead end? Must the range be in the format
("A1:A2")
to make this code work?

t =


Application.WorksheetFunction.CountA(Sheets("tele" ).Range(Cells(ActiveCell.R
ow, ActiveCell.Column + 79), Cells(ActiveCell.Row + 6, ActiveCell.Column

+
79)))

Thanks for any help.

Brgds

CG Rosén