Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Positioning Data / Form dialogue box


Hi there,

I have used this newsgroup a number of times now, and
people have always been very helpful.

My next question, :)

I have a macro which opens up a Data / Form dialogue box
on a different sheet to where the macro is called from.

The macro is a user input form and I have used a
different sheet so I can display instructions for the
user to refer to.

When the dialogue box opens, its initial position seems
random. I need it to display in the top-center of the
sheet so I can wrap guidance around it.

I can position the box myself, and then when I close it
and call it again from the macro, it remembers that
position, but it is the initial call when the spreadsheet
is opened which fails to position it where I need it.

I could give the users guidance how to position it but
would rather not.

Is there any way I can force an absolute display position
when I call it?

Many thanks in advance.

Mark Flaxman

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Positioning Data / Form dialogue box


Ohh dear no replies.

Looks like I cannot set the position of dialogue boxes
and I will have to think again.



-----Original Message-----

Hi there,

I have used this newsgroup a number of times now, and
people have always been very helpful.

My next question, :)

I have a macro which opens up a Data / Form dialogue box
on a different sheet to where the macro is called from.

The macro is a user input form and I have used a
different sheet so I can display instructions for the
user to refer to.

When the dialogue box opens, its initial position seems
random. I need it to display in the top-center of the
sheet so I can wrap guidance around it.

I can position the box myself, and then when I close it
and call it again from the macro, it remembers that
position, but it is the initial call when the

spreadsheet
is opened which fails to position it where I need it.

I could give the users guidance how to position it but
would rather not.

Is there any way I can force an absolute display

position
when I call it?

Many thanks in advance.

Mark Flaxman

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Positioning Data / Form dialogue box

Mark,

Are you looking to position a UserForm, a Dialog Box, or a Data Form? If
it's a UserForm, you could do something like this:

Private Sub UserForm_Activate()
With Application
Move (.UsableWidth / 2) - (Width / 2), _
.Height - .UsableHeight
End With
End Sub

This won't get it exactly where you want, as it depends on how tall the
user's menu bars are. But it should give you a good start. If you want the
code to "remember" where the user last left it (even after
closing/reopening), you could use an INI file, the registry, or store the
top and left values in a hidden sheet or name.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


Mark Flaxman wrote:
Ohh dear no replies.

Looks like I cannot set the position of dialogue boxes
and I will have to think again.



-----Original Message-----

Hi there,

I have used this newsgroup a number of times now, and
people have always been very helpful.

My next question, :)

I have a macro which opens up a Data / Form dialogue box
on a different sheet to where the macro is called from.

The macro is a user input form and I have used a
different sheet so I can display instructions for the
user to refer to.

When the dialogue box opens, its initial position seems
random. I need it to display in the top-center of the
sheet so I can wrap guidance around it.

I can position the box myself, and then when I close it
and call it again from the macro, it remembers that
position, but it is the initial call when the spreadsheet
is opened which fails to position it where I need it.

I could give the users guidance how to position it but
would rather not.

Is there any way I can force an absolute display position
when I call it?

Many thanks in advance.

Mark Flaxman

.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Positioning Data / Form dialogue box


Sorry m8, I had almost given up hope.

It is a DataForm called up from a macro using this VBA
code:

VBA code for OpenDataForm

Sub OpenDataForm()

Dim ws As Worksheet
Set ws = Worksheets("Record")

SendKeys "%w"
ws.Range("Database").Worksheet.ShowDataForm
End Sub


Where "Database" is a named range using a dynamic range
of cells. The user will input 8 lines of information
which will be entered into the next empty row in the
range.

Scroll bars are turned off, as are Sheet Tabs, and column
and row headers, and when the user saves the spreadsheet
prior to exiting, (called from a macro), the spreadsheet
maximises, so that, when it is opened by another user, it
opens full screen. That way, the GUI dimensions remain
static.

So, could I use your code for a DataForm instead of a
UserForm?

If so, can you explain your code? My VBA isn't good.

Where do I enter the values?

Many thanks for replying.

Mark Flaxman
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
Need help positioning data labels Bob Charts and Charting in Excel 3 February 12th 10 02:21 PM
Data Series Label Positioning Thomas M. Charts and Charting in Excel 5 May 18th 09 11:37 PM
Positioning charts & pictures with data for printing Papermaker Excel Discussion (Misc queries) 0 November 4th 08 04:36 PM
Secondary Y-Axis -- Positioning of Plotted Data [email protected] Charts and Charting in Excel 0 October 25th 07 08:17 PM
Two responding dialogue boxes for data validation FARAZ QURESHI Excel Discussion (Misc queries) 2 January 19th 07 04:47 AM


All times are GMT +1. The time now is 08:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"