#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Form Micro


I am trying to active a form from a macro. I used the 'copy' function but it
fails. It tells me that the ShowDataFrom method failed. The spreadsheet will
be used my schools in our district to register students for the science
fair. I'm not the proficient in Excel.

Sub InputList()
'
' InputList Macro
' Macro recorded 10/5/2006 by 'Jim C'

'
Sheets("Names").Select
Range("A4:E4").Select
ActiveSheet.ShowDataForm
End Sub

Thanks Jim C


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Form Micro

Excel _knows_ where to look for the data (and screws up).

Here's an article that explains how the problem occurs in VBA (with solution)
http://support.microsoft.com/default...;en-us;q110462
XL: ShowDataForm Method Fails If Data Can't Be Found



Jim Cox wrote:

I am trying to active a form from a macro. I used the 'copy' function but it
fails. It tells me that the ShowDataFrom method failed. The spreadsheet will
be used my schools in our district to register students for the science
fair. I'm not the proficient in Excel.

Sub InputList()
'
' InputList Macro
' Macro recorded 10/5/2006 by 'Jim C'

'
Sheets("Names").Select
Range("A4:E4").Select
ActiveSheet.ShowDataForm
End Sub

Thanks Jim C


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Form Micro

"UserForm1.Show" without the quotemarks will work if you only have one
UserForm for that workbook. To make it go away use "Unload UserForm1" ,
again without the quotemarks. You don't need the ActiveSheet preface since
the UserForm is a stand alone object.

If the UserForm has a name, you can use it instead of UserForm1, i.e.
"FormName.Show"

"Jim Cox" wrote:


I am trying to active a form from a macro. I used the 'copy' function but it
fails. It tells me that the ShowDataFrom method failed. The spreadsheet will
be used my schools in our district to register students for the science
fair. I'm not the proficient in Excel.

Sub InputList()
'
' InputList Macro
' Macro recorded 10/5/2006 by 'Jim C'

'
Sheets("Names").Select
Range("A4:E4").Select
ActiveSheet.ShowDataForm
End Sub

Thanks Jim C



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Form Micro

Thanks for the info, but I'm still having a problem. At least I'm headed in
the right direction

Thanks
Jim C
"Dave Peterson" wrote in message
...
Excel _knows_ where to look for the data (and screws up).

Here's an article that explains how the problem occurs in VBA (with
solution)
http://support.microsoft.com/default...;en-us;q110462
XL: ShowDataForm Method Fails If Data Can't Be Found



Jim Cox wrote:

I am trying to active a form from a macro. I used the 'copy' function but
it
fails. It tells me that the ShowDataFrom method failed. The spreadsheet
will
be used my schools in our district to register students for the science
fair. I'm not the proficient in Excel.

Sub InputList()
'
' InputList Macro
' Macro recorded 10/5/2006 by 'Jim C'

'
Sheets("Names").Select
Range("A4:E4").Select
ActiveSheet.ShowDataForm
End Sub

Thanks Jim C


--

Dave Peterson



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Form Micro

Do you know how many columns are part of the data table?

Can you pick out a column that always has data if that row is used?

Option Explicit
Sub testme01()
Dim LastRow as long
Application.DisplayAlerts = False
With activesheet
lastrow = .cells(.rows.count,"A").end(xlup).row
.Range("A4:E" & lastRow).Name = "'" & .Name & "'!database"
.ShowDataForm
End With
Application.DisplayAlerts = True
End Sub

I started in A4 (like your code showed) and then used column A to find the last
row used. And went to column E (like your code showed).

By naming the range DataBase, excel's showdataform knew where to look to find
the data.

Jim Cox wrote:

Thanks for the info, but I'm still having a problem. At least I'm headed in
the right direction

Thanks
Jim C
"Dave Peterson" wrote in message
...
Excel _knows_ where to look for the data (and screws up).

Here's an article that explains how the problem occurs in VBA (with
solution)
http://support.microsoft.com/default...;en-us;q110462
XL: ShowDataForm Method Fails If Data Can't Be Found



Jim Cox wrote:

I am trying to active a form from a macro. I used the 'copy' function but
it
fails. It tells me that the ShowDataFrom method failed. The spreadsheet
will
be used my schools in our district to register students for the science
fair. I'm not the proficient in Excel.

Sub InputList()
'
' InputList Macro
' Macro recorded 10/5/2006 by 'Jim C'

'
Sheets("Names").Select
Range("A4:E4").Select
ActiveSheet.ShowDataForm
End Sub

Thanks Jim C


--

Dave Peterson


--

Dave Peterson
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
Micro Ganesh Kumar Excel Worksheet Functions 2 July 21st 09 03:54 PM
HOW TO RECORD A MICRO feedback as soon as possible Excel Worksheet Functions 1 August 8th 08 09:19 AM
Micro roheel Excel Programming 0 April 26th 05 09:43 AM
Micro djmimi Excel Worksheet Functions 0 February 9th 05 05:29 PM
what does the micro do Ibrahim New Users to Excel 1 December 8th 04 01:54 PM


All times are GMT +1. The time now is 09:34 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"