Force Focus Back: Pop Up A Userform To Provide Instructions And Collect Some Additional Data From The User

Feb 18, 2009

I'm working on a spreadhseet which has several macros that can take up to 5 minutes to run. When the macro(s) complete, I pop up a userform to provide instructions and collect some additional data from the user.

The "problem" is that when the user moves to another application to do other work, the user form remains hidden behind the active app. I've added some text to the status bar to let the users know the processing is done, but they would like something more obvious - so, is there any way I can force focus back to Excel?

View 2 Replies


ADVERTISEMENT

Force Focus To Range From Modeless UserForm

Nov 21, 2007

A userform to move the curser to a column then activate the Excel App and keep the userform visiable.

The problem is when excution the code step by step (F8) works fine, but when excution the code by F5 the cursor moves to the Range("A65536").End(xlUp) and doesnot then move to the required column.

also this line
AppActivate ("Microsoft excel")

does not work , it gives me Invalid proceduers or call argument.

Private Sub ComboBox1_Change()

Range("A65536").End(xlUp).Activate
If ComboBox1.ListIndex = 0 Then Cells(ActiveCell.Row, "I").Activate
If ComboBox1.ListIndex = 1 Then Cells(ActiveCell.Row, "J").Activate
If ComboBox1.ListIndex = 2 Then Cells(ActiveCell.Row, "K").Activate

AppActivate ("Microsoft excel")

End Sub

View 9 Replies View Related

Modeless Userform :: Set The Focus Back On The Range

Aug 1, 2008

I call a userform (modeless), and then i'm trying to set the focus back on the range that was selected when i showed the userform. you would think i could just define the range and then use rnge.select like this....

set prevrnge = selection

UF.show (vbmodeless)

prevrnge.select

but it doesn't take the focus off the userform....

View 9 Replies View Related

Force Garbage Collect

Jul 11, 2007

Is there any way to force some sort of garbage collect in order to free up memory? I am running some code which takes values from one workbook and pastes them into the control workbook. It currently works when 15 sheets of data are being moved however, my data has just grown to 16 sheets and now the code gives me the not enough resources message. If a garbage collect would solve this issue would I need to also reset any variables I had defined in the code?

View 9 Replies View Related

Giving Back Focus

May 10, 2007

I've got a Macro that generates three reports for me, one at a time.

After a report has been generated it creates an Email and attachs the report to the Email, I then check the report is ok before sending out.

The problem is, that once the first Email has been generated Excel is pushed into the background and the macro sloooooooows down.

I believe (though I will quite happily be wrong) this is because Excel is no longer the PC's main concern.

What I was wondering was, is it possible to bring Excel back to the foreground once the Email has been generated.

View 9 Replies View Related

Set Focus Back To Workbook While Form Is Active

Nov 11, 2009

I have a userform, when using the form it has focus, once I click on my "Ok" command button I want to return focus to the workbook while I leave the userform open. I already have the userform open and on top of the workbook.

View 2 Replies View Related

ComboBox And Get Focus Back To Sheet Or Cell?

Oct 24, 2012

Code:
Private Sub ComboBox1_Change()
ActiveCell = Me.ComboBox1.Value
End Sub

How do I get focus back to the sheet or cell instead of the ComboBox ?

View 1 Replies View Related

Collect Month & Year From User

Dec 8, 2006

Date = InputBox("Enter the production month date in YYYYMM format", "DATE") 'This is the only info I want them to enter

Windows("PCN4.xls").Activate
Sheets("Bring the data in here").Select
Range("A" & NextLine).Select
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;W:C30MonthlyMonthly NEW TCs200610 otconsa.txt", Destination:=Range _ ' I only need the 200610 to change every month
("A" & NextLine))
.Name = "totconsa"
End With

View 9 Replies View Related

Collect Formula From User & Add To Range

Jul 7, 2007

I create a macro which ask the user to input a formula(user can select a range in the excel screen), then I copy this formula to a specific row of every worksheets.

The problem is Application.InputBox("Insert a Formula", "This accepts Formula", 0+2) can not return the formula, it will automatically evaluate this formula and return a value!

This code is:

Sub CreateNewItem1()
Dim bFormula As String
hi=10
Application. ScreenUpdating = True

' here is the INPUTBOX-method :
On Error Resume Next
Application.DisplayAlerts = False
bFormula =Application.InputBox("Insert a Formula", "This accepts Formula", 0+2 )
On Error Goto 0
Application.DisplayAlerts = True
MsgBox "You have inserted bFormula is:" & bFormula

'Cells(hi, 2).Select.FormulaLocal = bFormula
' MsgBox Cells(hi, 2).Select.FormulaLocal

Call CreateNewItem2((hi)) 'call the copy formula macro
End Sub

View 7 Replies View Related

Copying Data From UserForm To SpreadSheet And Back Again?

Feb 21, 2013

We created a database for our employees who have security items and other things we need to keep track. We created a spreadsheet where data was entered on Sheet2 (Entry Form) and then by clicking various buttons would be thrown over to Sheet1 (MasterList) and put in alphabetical order. Then last week he said lets change it to a User form where i can put all the data, be able to tab through my text boxes and make the whole process of entering information faster and more efficient.. but now hes gone and I'm left with his macros and all this stuff i don't really understand! I have been doing pretty well on my own but im stuck "Search Employee" Here is what i have...


VB:
Private Sub SearchEmployeeButton_Click()
LastName.Value = Range("A500").Value
FirstName.Value = Range("B500").Value

[Code]....

use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window.

View 2 Replies View Related

VBA Code To Repopulate All Data Back To Userform?

Mar 31, 2014

Any formula to repopulate the data back to userform for editing. I need the data to populate when a record is selected from a combo box [named URN for unique reference number]

View 5 Replies View Related

Paste Data From Userform Back Into Spreadsheet

Jan 3, 2013

I have a "txtQuoteNo" box used in my userform "FrmQuotation", and this is recorded in column A of my Central Data spreadsheet (with a fair slug of other data from the userform).

I can currently recall the data into the userform from the spreadsheet using the QuoteNo, but when I need to resubmit it back to the spreadsheet, I can't see why the following code posts this new data onto a new line rather than the blank cells in the corresponding row of txtQuoteNo and column A (if you see what I mean...)

Set wb = Workbooks.Open("M:Central Taxi Data.xlsx")
With Sheets("Data").Range("A:A")
Set cell = .Find(myVal, LookIn:=xlValues)
rw = cell.Row
End With

RowCount = Worksheets("Data").Range("A" & rw).CurrentRegion.Rows.Count

[Code] .......

View 3 Replies View Related

Collect Date From User And Pass To Variable

Sep 9, 2006

I have an existing macro which I am enhancing and I would like to have the user provide a date, either with a popup text box in a userform and then use a command button to hit OK and have the box dissapear, or in a calender which the date is selectable, and the date supplied go into a variable.

View 2 Replies View Related

Collect Date From User & Check If Valid

Aug 31, 2007

want to do something simple, and it just wont paste. not sure why. anyone care to look it over and tell me what i'm doing wrong here?

'Insert Date Information
Dim vDate As Date
Range("D2").Select
ActiveCell.FormulaR1C1 = Date
vDate = Date

'Get date from user
Dim dDate As Date
vDate2 = Application.InputBox(Prompt:="Type in the due date for the location." _
& Chr(13) & Chr(13) & "*If you want the date to default to " & Date + 5 & " then leave the field blank.", _
Title:="Due Date", Type:=1 + 2).............

View 3 Replies View Related

Collect Password From User & Match To List

Jan 29, 2008

I have an input box for a password, and my vb code checks the password against a list, and if it is correct allows the user to continue. I want to change the input box for a user form, as it allows more text on the form, and I also want to include a checkbox that the user must tick to show that they have read and understood the instructions. I have defined the form, but am having trouble getting the form to interpret the user input.

The form has one checkbox, which needs to be ticked to continue, otherwise give a message saying that you have to confirm. It also has one textbox, for the user to input the password. I dont understand how to name the contents of the text box, and use it in the following code. Also do I need a "send" button on the user form, for the user to click after entering the password. If so how does that work?

View 4 Replies View Related

Collect Date From User For Save File Name

Jun 21, 2008

We have an excel file which is made every thursday for comparison purposes etc. I've made an macro (excel 2003) which - on start - asks via an inputbox for the extension in date format for saving purposes. Later on, the macro will search for the same file but from last week to open it and copy/paste a 'comments' column into this new one. All went well, everybody happy. However it may be well possible that file is made and saved but with an extra extension: example:

dir to save = C:file

file when starts runs inputbox "Please enter a date (e.g. 2008-06-20)"
The macro records this string as mydate:

Sub Start()
Dim AnyString
Dim MyStr
Dim DirString
Dim mynum 'As String
Dim resp As Long
Dim get_mynum
Dim mydate

'Define extension for the file name to be saved and the correct path (dir) where this file will be stored.
get_mynum:
mynum = Application.InputBox("Enter the filename's extension to save in yyyy-mm-dd (e.g. 2008-06-30)", vbOKCancel)
If mynum = False Then
msgbox ("You do not want to continue? Ok, programm stopped")
Exit Sub
ElseIf mynum = "" Then..............

View 9 Replies View Related

Collect Valid Range Address From User

Jun 27, 2008

I'm getting a cell address from user. I need to check whether the cell address is a valid cell address.. How do I do it.

Dim s As String

s = InputBox("Enter a valid cell reference")

If (S Is a valid cell reference) Then
MsgBox "success"
Else
MsgBox "Failure"
End If

I tried doing this using Left and Right string functions. But thats going very complex.

View 3 Replies View Related

Putting Data Collected In UserForm Back Into Worksheet

Apr 14, 2013

I'm trying to set up a relatively simple UserForm, which will collect the name of a project from a ListBox, a project update which will simply be text entered into a TextBox, and a estimated completion percentage (factor of 10, 10/20/30% and so on) which will come from another ListBox.

I've managed to get many of the basics working, for example an OK button and a CANCEL button, but there are a few bits that I'm still finding rather tricky.

I have the selected date in the percentage listbox going back into my chosen place in the spreadsheet quite happily, but I can't get it to work for the project name listbox (I think it's because the options come from rowsource and weren't entered manually like the other one). I'll paste my code at the end so you can all see how I've done it (and have a laugh)!

I have also just about managed to get the data to go to the right place in the spreadsheet. I want the data to appear in columns, column 1 for the project name, project update in 2 and percentage complete in 3. I have this working, but it for any reason one cell becomes blank, my code uses that cell, and that could cause entries to become mixed up. I want the UserForm to enter data on the first entirely empty row.

Here's my code:

VB:
Private Sub Cancel_Click()
Unload ProjectUpdate
End Sub

Private Sub Clear_Click()
Call UserForm_Initialize
End Sub

[Code] .....

View 7 Replies View Related

Finding Out Which Box On A User Form Has Focus

Feb 13, 2009

Need the way of getting the name of the text box that currently has focus on a user form?

View 5 Replies View Related

Cell Focus When Opening A User Form

May 9, 2007

i would like to retain the focus of the current cell before the user clicks on a button to run a macro (see below) to open a userform...?

userform.show

(the cell focus seems to disapper...after the button is clicked, but does stay on the cell when i run the macro from tools macros...)

View 5 Replies View Related

Set Focus To Text Box Upon User Form Show

Sep 22, 2007

I have a TextBox and 2 Commandbuttons. I need the cursor to return to the TextBox when the Userform is loaded without the user selecting the TextBox.

View 3 Replies View Related

Force The User To Enable The Macro

Mar 4, 2009

I have Excel file that is linked to Access Database. Everytime the user opens the file, there is pop up message that warns the user we there to enable the macro or to disable it. I want to force the user to enable the macro or even better if I can make disappear this warning and automatically enable the macro. See attached for more details.

View 3 Replies View Related

How To Force User To Fill In Three Of Four Available Cells

Sep 16, 2013

I'm trying to force the user to fill in three of the four available cells.

Initially they have a choice of filling in data for either:

Sheets(1).Range("C4")
or
Sheets(1).Range("C6")

But after that both Sheets(1).Range("C8") & Sheets(1).Range("C11") cells must also be filled in.

So it's either cells:-
C4 + C8 + C11
Or
C6 + C8 + C11

View 1 Replies View Related

To Force A User To Enter A Numeric Value

Mar 10, 2008

I'm trying to force a user to enter a numeric value, (one numeric value between 0 and 8, inclusive) into a range of cells, prior to exiting the spreadsheet.

The range would be D7:D252, and a single value would have to be entered into each range prior to exiting the spreadsheet.

View 9 Replies View Related

Force User Form Entry Only

Dec 30, 2007

I want to change data through a user form and disable users from going around my form. I want users to see the underlying spreadsheet as the form manipulates data.

If I enable a form in Modal mode users can bypass the form. If I use it without modal form I can't change data from my form. I seem to be in a catch 22.

View 5 Replies View Related

Cells With Instructions Which Disappear When Data Entered?

Jan 29, 2009

creating a template for people. In the template, I want to create cells which instruct the user on what need to be filled in that cell.

For eg. go to [URL] In the box, it says 'Enter word or phrase'. When you click to enter a word, this line vanishes. I want to create a similar thing in Excel.

In Excel, for eg, in a cell it should say 'Enter Name' and when the user enter his name, this instruction should vanish. Also, this instruction should be in GREY and when they user enters his name it should be BOLD BLUE.

View 14 Replies View Related

Cells With Instructions Which Disapper When Data Entered

Jan 29, 2009

I needed some help in creating a template for people. In the template, I want to create cells which instruct the user on what need to be filled in that cell.

For eg. go to www.m-w.com In the box, it says 'Enter word or phrase'. When you click to enter a word, this line vanishes. I want to create a similar thing in Excel.

In Excel, for eg, in a cell it should say 'Enter Name' and when the user enter his name, this instruction should vanish. Also, this instruction should be in GREY and when they user enters his name it should be BOLD BLUE.

View 13 Replies View Related

Input Box Instructions/restrictions For Filtering Data

Nov 12, 2007

Is there a way that I add instructions/restrictions to the push buttons on my form (basically they perform filter functions).
For instance, currently the only way to search the client or employee name is to enter the entire name. Is there a way to allow partial name searches?

Can I have a message appear that says "'Joe Shmo' can not be found".

Also I would like the input box not allow blank searches. If the input box is selected but then closed with no data entered, it filters for blanks which removes all data.

I have attached a sample of my form for you to look at.

View 11 Replies View Related

Setting Focus On Userform

Jul 7, 2009

I have a userform that is called by clicking on a button and it copies the value in cell A to my userform. This works great it is called via:

View 5 Replies View Related

Set Focus To TextBox On UserForm

Oct 16, 2006

On the summary page click on 'Enter Sale' and notice that Customer Advisor' text box gets the focus and the cursor is flashing. (Which is what I want). Enter any name and a sale value (say 'A' and '1') and click the 'OK' button
But when I tried to enter another sale the OK button still had the focus. So in the VBA Project / Forms / frm_sale / OK Click event - near the bottom
I added a set focus before the 'frm_sale.hide' - This removed the focus from the 'OK' box - but the cursor is still not in the text box, and it needs to be clicked in order to enter text. This is clearly something trivial I am missing - but the blinkers are on and I cant spot it

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved