ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Excel 2003 accepting error message in macro (https://www.excelbanter.com/excel-discussion-misc-queries/264445-excel-2003-accepting-error-message-macro.html)

BJ&theBear

Excel 2003 accepting error message in macro
 
This very short macro below creates a userform which can be searched
to find the required contract number.

However when it is "run" an error message appears that "Excel cannot
determine which row contains column labels then it gives you
options:-

if headings are 1st row press OK - "this is the case"
or if you selected a subset of cells in error, select a single cell
and try again
or create column text labels (already done)
or for info on labels select help

Any help on removing this error message - there are just four columns
and all are labelled in the first row with text labels



Sub create searchuserform()

' Macro
' Macro recorded 19/05/2010 by Brian


Sheets("ProjectList").Select
Columns("A:D").Select
ActiveSheet.ShowDataForm
End Sub


Any help would be appreciated

Thanks

Brian
Scotland

Jim Cone[_2_]

Excel 2003 accepting error message in macro
 

It is a strange animal. Name the range you are working on "Database"...

Sub createsearchuserform()
Sheets("ProjectList").Columns("A:D").Name = "Database"
Sheets("ProjectList").Select
Sheets("ProjectList").ShowDataForm
End Sub
'Note: no spaces in the sub name.
'And you don't have to select the sheet - depends on how strange you want to make it..
--
Jim Cone
Portland, Oregon USA
( http://tinyurl.com/ExtrasForXL )





"BJ&theBear"
wrote in message ...
This very short macro below creates a userform which can be searched
to find the required contract number.
However when it is "run" an error message appears that "Excel cannot
determine which row contains column labels then it gives you
options:-
if headings are 1st row press OK - "this is the case"
or if you selected a subset of cells in error, select a single cell
and try again
or create column text labels (already done)
or for info on labels select help

Any help on removing this error message - there are just four columns
and all are labelled in the first row with text labels

Sub create searchuserform()
' Macro
' Macro recorded 19/05/2010 by Brian
Sheets("ProjectList").Select
Columns("A:D").Select
ActiveSheet.ShowDataForm
End Sub

Any help would be appreciated
Thanks
Brian
Scotland

BJ&theBear

Excel 2003 accepting error message in macro
 
On May 25, 1:01*pm, "Jim Cone" wrote:
It is a strange animal. *Name the range you are working on "Database"....

Sub createsearchuserform()
* * Sheets("ProjectList").Columns("A:D").Name = "Database"
* * Sheets("ProjectList").Select
* * Sheets("ProjectList").ShowDataForm
End Sub
'Note: no spaces in the sub name.
'And you don't have to select the sheet - depends on how strange you want to make it..
--
Jim Cone
Portland, Oregon *USA
(http://tinyurl.com/ExtrasForXL)

"BJ&theBear"
wrote in ...
This very short macro below creates a userform which can be searched
to find the required contract number.
However when it is "run" an error message appears that "Excel cannot
determine which row contains column labels *then it gives you
options:-
*if headings are 1st row press OK - "this is the case"
or if you selected a subset of cells in error, select a single cell
and try again
or create column text labels (already done)
or for info on labels select help

Any help on removing this error message - there are just four columns
and all are labelled in *the first row with text labels

Sub create searchuserform()
' Macro
' Macro recorded 19/05/2010 by Brian
* * Sheets("ProjectList").Select
* * Columns("A:D").Select
* * ActiveSheet.ShowDataForm
End Sub

Any help would be appreciated
Thanks
Brian
Scotland


Thanks Jim - worked a treat

BJ


All times are GMT +1. The time now is 04:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com