Excel 2003 accepting error message in macro

B

BJ&theBear

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
 
J

Jim Cone

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" <[email protected]>
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
 
B

BJ&theBear

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 wantto make it..
--
Jim Cone
Portland, Oregon  USA
(http://tinyurl.com/ExtrasForXL)

"BJ&theBear" <[email protected]>
wrote in messageThis 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top