impossible syntax??

  • Thread starter Thread starter CG Rosén
  • Start date Start date
C

CG Rosén

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
 
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
 
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
 
Hi,

Thanks RADO and Tom Ogilvy for your answers, always a
pleasure to learn something new.

Brgds

CG Rosén
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top