Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to Reset data input form | Excel Worksheet Functions | |||
Data Form, Macro and Countif | Excel Worksheet Functions | |||
Data Entry Form: Macro-One To Many | Excel Discussion (Misc queries) | |||
Data Form has macro issues | Excel Discussion (Misc queries) | |||
Repeat form printing with new data by macro | Excel Discussion (Misc queries) |