Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Control record displayed in DataForm window
The Excel data/form window facilitates entering data when the fields in
a record extend over more than the width of the display screen. The VBA command, "dataform," opens the data form window, but it always displays the top record on the sheet. Once it is open, you can then manually scroll down to any record on the sheet. Is there any way to control which record it displays on opening in Excel95 or Excel97 other than reordering the sheet so that the record of interest is at the top of the sheet? Michael in Los Angeles |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Control record displayed in DataForm window
You could use send keys:
SendKeys "{DOWN " & ActiveCell.Row - 2 & "}" Application.DisplayAlerts = False ActiveSheet.ShowDataForm Application.DisplayAlerts = True This will start the dataform on the row with the activecell. Replace activecell.row with the number of the row you want to start on. buczacz wrote: The Excel data/form window facilitates entering data when the fields in a record extend over more than the width of the display screen. The VBA command, "dataform," opens the data form window, but it always displays the top record on the sheet. Once it is open, you can then manually scroll down to any record on the sheet. Is there any way to control which record it displays on opening in Excel95 or Excel97 other than reordering the sheet so that the record of interest is at the top of the sheet? Michael in Los Angeles -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Control record displayed in DataForm window
I could not get the code you suggested to work.
I could not find a way to specify the number of down keystrokes. Instead I used: NDX = 1: Do While NDX < IDN: SendKeys "{down}": NDX = NDX + 1: Loop Application.DisplayAlerts = False ActiveSheet.ShowDataForm Application.DisplayAlerts = True Where IDN (Identification Number) is the number of the desired row to which I want to scroll. Could the problem be that I'm currently running it in Excel95? Thanks for the hint. Michael Dave Peterson wrote: You could use send keys: SendKeys "{DOWN " & ActiveCell.Row - 2 & "}" Application.DisplayAlerts = False ActiveSheet.ShowDataForm Application.DisplayAlerts = True This will start the dataform on the row with the activecell. Replace activecell.row with the number of the row you want to start on. buczacz wrote: The Excel data/form window facilitates entering data when the fields in a record extend over more than the width of the display screen. The VBA command, "dataform," opens the data form window, but it always displays the top record on the sheet. Once it is open, you can then manually scroll down to any record on the sheet. Is there any way to control which record it displays on opening in Excel95 or Excel97 other than reordering the sheet so that the record of interest is at the top of the sheet? Michael in Los Angeles |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Control record displayed in DataForm window
Instead of using sendkeys within your loop, just figure out how many and pass
that number to it: SendKeys "{DOWN " & NDX - 2 & "}" But I'm not sure how you determined how many to come down, either. buczacz wrote: I could not get the code you suggested to work. I could not find a way to specify the number of down keystrokes. Instead I used: NDX = 1: Do While NDX < IDN: SendKeys "{down}": NDX = NDX + 1: Loop Application.DisplayAlerts = False ActiveSheet.ShowDataForm Application.DisplayAlerts = True Where IDN (Identification Number) is the number of the desired row to which I want to scroll. Could the problem be that I'm currently running it in Excel95? Thanks for the hint. Michael Dave Peterson wrote: You could use send keys: SendKeys "{DOWN " & ActiveCell.Row - 2 & "}" Application.DisplayAlerts = False ActiveSheet.ShowDataForm Application.DisplayAlerts = True This will start the dataform on the row with the activecell. Replace activecell.row with the number of the row you want to start on. buczacz wrote: The Excel data/form window facilitates entering data when the fields in a record extend over more than the width of the display screen. The VBA command, "dataform," opens the data form window, but it always displays the top record on the sheet. Once it is open, you can then manually scroll down to any record on the sheet. Is there any way to control which record it displays on opening in Excel95 or Excel97 other than reordering the sheet so that the record of interest is at the top of the sheet? Michael in Los Angeles -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Control on a form to find a record | Excel Discussion (Misc queries) | |||
how files are displayed in the open file window | Excel Discussion (Misc queries) | |||
Getting control toolbox button to record a macro. | Excel Discussion (Misc queries) | |||
Function to control how data displayed | Excel Discussion (Misc queries) | |||
window control | Excel Programming |