Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default detect column name of last populated data


i need to detect column name showing msgbox of last used range column

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default detect column name of last populated data


Use:

Sub LastColumn_Number()

num = ActiveSheet.UsedRange.Columns.Count
numq = ActiveSheet.UsedRange.Column - 1
MsgBox num + numq

End Su

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default detect column name of last populated data


Good work. but i need column *NAME* and not NUMBER

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find the first or last populated column in a range Commish Excel Worksheet Functions 6 May 14th 09 10:16 PM
Last populated cell in a column RedFive Excel Discussion (Misc queries) 1 October 3rd 08 09:01 PM
Last populated cell in a column RedFive Excel Discussion (Misc queries) 7 October 3rd 08 08:58 PM
Referencing last populated cell in a column flint Excel Worksheet Functions 2 April 28th 07 09:21 AM
how can I find last populated cell in a row (or column) Frank Kabel Excel Programming 2 May 17th 04 04:32 PM


All times are GMT +1. The time now is 01:37 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"