View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
ilyaskazi[_51_] ilyaskazi[_51_] is offline
external usenet poster
 
Posts: 1
Default detect column name of last populated data


ok here is the solution...


Code
-------------------
Dim a As string
Dim num, numq, cn

num = ActiveSheet.Usedrange.Columns.count
numq = ActiveSheet.Usedrange.Column - 1
cn = num + numq

Cells(1, cn).Select
a = ActiveCell.Address

MsgBox Left(Right(a, Len(a) - 1), InStr(Right(a, Len(a) - 1), "$") - 1
-------------------


thankyou.

--
ilyaskaz
-----------------------------------------------------------------------
ilyaskazi's Profile: http://www.excelforum.com/member.php...fo&userid=2396
View this thread: http://www.excelforum.com/showthread.php?threadid=38980