Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hello, I would like to create a macro to search Column A for any entries & if there is no data in Column A, insert the words "No Data" into Cell A2. If there is data, then sort the data descending. I can sort the data, but am not sure how to search the column ?? Thanks, Oreg -- Oreg ------------------------------------------------------------------------ Oreg's Profile: http://www.excelforum.com/member.php...fo&userid=9195 View this thread: http://www.excelforum.com/showthread...hreadid=381181 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Oreg,
Set rng = Worksheets("Sheet1").Range("A:A") If WorksheetFunction.CountA(rng) = 0 Then ' no data in column A Worksheets("Sheet1").Range("A2") = "No Data" End If Ed Ferrero http://edferrero.m6.net I would like to create a macro to search Column A for any entries & if there is no data in Column A, insert the words "No Data" into Cell A2. If there is data, then sort the data descending. I can sort the data, but am not sure how to search the column ?? Thanks, Oreg |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Something like this probably: If WorksheetFunction.CountA(Range("A:A")) = 0 Then Range("A2") = "No Data" Else Columns("A:A").Select Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal End If Mangesh -- mangesh_yadav ------------------------------------------------------------------------ mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470 View this thread: http://www.excelforum.com/showthread...hreadid=381181 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Mangesh & Ed, Thanks for the responses....that's just what I needed !! Ore -- Ore ----------------------------------------------------------------------- Oreg's Profile: http://www.excelforum.com/member.php...nfo&userid=919 View this thread: http://www.excelforum.com/showthread.php?threadid=38118 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Searching data in a column via Input Box | New Users to Excel | |||
Searching for partial data in a column | Excel Discussion (Misc queries) | |||
Searching a column | Excel Programming | |||
Searching In a Column | Excel Programming | |||
Searching for Data Values in a Column - Formula Only | Excel Programming |