Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to test a named cell in the excel sheet to see if there is any
data in the cell. Currently I am doing: 'Req Number If Trim(Cells(4, 7)) = "" Then errtest = errtest & "Please Fill in the Req Number" End If The problem is that the cells 4,7 may change, as new lines get added to the sheet. So I have named it ReqNo in the sheet. Then even if new lines are added, the test will still be on the correct field. But I don't know how to call it. I have tried the following: Cells("ReqNo") Cells('ReqNo') Activecell.ReqNo select.cell.ReqNo ect, ect , ect Does anyone know how to call a named cell in the macro? Cheers for all help, Caroline |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use range to select a named cell
ActiveSheet.Range("reqno") = "123" -- -John Please rate when your question is answered to help us and others know what is helpful. " wrote: I need to test a named cell in the excel sheet to see if there is any data in the cell. Currently I am doing: 'Req Number If Trim(Cells(4, 7)) = "" Then errtest = errtest & "Please Fill in the Req Number" End If The problem is that the cells 4,7 may change, as new lines get added to the sheet. So I have named it ReqNo in the sheet. Then even if new lines are added, the test will still be on the correct field. But I don't know how to call it. I have tried the following: Cells("ReqNo") Cells('ReqNo') Activecell.ReqNo select.cell.ReqNo ect, ect , ect Does anyone know how to call a named cell in the macro? Cheers for all help, Caroline |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Named Cell test | Excel Discussion (Misc queries) | |||
exit macro after test of cell value | Excel Programming | |||
Test if ActiveCell is within a certain named range | Excel Programming | |||
How to test cell contents in a macro? | Excel Programming | |||
Test if Active Cell is in a named range | Excel Programming |