View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
thomas donino thomas donino is offline
external usenet poster
 
Posts: 89
Default finding last column from a target row

All fixed, thank you all for the help

"Jim Cone" wrote:

You also need to change...

xlRight to xlToRight
--
Jim Cone
Portland, Oregon USA



"thomas donino"
wrote in message
...
Sub testcol()
Set newtargCell = Range("A2")
Set newtargCell = newtargCell.End(xlRight)
Lastcolumn = newtargCell
MsgBox "Last column is" & newtargCell
End Sub

is the correct code, but doesn't work




"Jim Cone" wrote:
What is targCell ?

row2 or Column 2 ?
--
Jim Cone
Portland, Oregon USA




"thomas donino"

wrote in message
...
Set newtargcell = Range("A2")
Set newtargcell = targCell.End(xlRight)

the last produces an error, shouldnt it find the last cell to the right of row2?