Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
jk jk is offline
external usenet poster
 
Posts: 109
Default Macro to bring up Data Form

Hi,
I have an excel sheet with which I want a macro button to bring up the Data
Form (simply instead of going to the menu dataform).

ActiveSheet.ShowDataForm
End Sub

Problem is that I have a row above the column headings which has merged
cells and when the macro runs it seems to not like it. Although if I simply
goto DataForm via the menu it works. I suspect I need to define range or to
exclude the row that has the merged cells rather than simply ActiveSheet. I
have tried but doing something wrong...

Please help!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Macro to bring up Data Form

Saved from a previous post...

Maybe your data doesn't start in the location excel expects:

http://support.microsoft.com/default...;en-us;q110462
XL: ShowDataForm Method Fails If Data Can't Be Found

You can use code like this if you know (or can determine) the range:

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

I started in A4 until the last used row in column A, then extended it to columns
A:X of those rows.

jk wrote:

Hi,
I have an excel sheet with which I want a macro button to bring up the Data
Form (simply instead of going to the menu dataform).

ActiveSheet.ShowDataForm
End Sub

Problem is that I have a row above the column headings which has merged
cells and when the macro runs it seems to not like it. Although if I simply
goto DataForm via the menu it works. I suspect I need to define range or to
exclude the row that has the merged cells rather than simply ActiveSheet. I
have tried but doing something wrong...

Please help!


--

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
Macro to Reset data input form MichaelRobert Excel Worksheet Functions 5 September 18th 09 02:55 PM
Data Form, Macro and Countif helen wheels Excel Worksheet Functions 1 November 23rd 07 10:31 PM
Data Entry Form: Macro-One To Many [email protected] Excel Discussion (Misc queries) 10 April 20th 07 01:04 PM
Data Form has macro issues SIR Knight Excel Discussion (Misc queries) 2 December 12th 06 12:39 PM
Repeat form printing with new data by macro Alec H Excel Discussion (Misc queries) 1 February 22nd 06 03:26 PM


All times are GMT +1. The time now is 06:19 PM.

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"