How To Dim A Response (from Input Box) Throughout Different Modules

Jan 21, 2014

I'm working with a substantial amount of code (which, due to its size, has been spread out into different modules). Whenever I transition from one module to the other, I have placed a msg at the beginning of each module to prompt the user to simply insert an integer to signify which version of the automation that is run. The following is an excerpt of a sample msg

[CODE]
Dim Msg, Title As String
Dim MyInput As Integer
' Define message."

[Code].....

Where, whatever report is being run, will be the same throughout all of the modules (for example, if you run the "Day" Report" at the beginning, the rest of the automation should be run using the "Day Report" code, not the "Night Report").

Is there a way to do one of the following

1. Label the input of "Day Report" or "Night Report" at the beginning of the automation (where the above except of code is how that would be done), and that can then be the determinant through the rest of the modules

2. Set my code in a specific module to, when it completes, automatically go to the same style of report (Day or Night) in the next module.

View 1 Replies


ADVERTISEMENT

Trying To Prepare For Every Possible Input Box Response

Jul 25, 2008

I have an input box that should only have numeric input. I have arranged for it to start loop back to the beginning of the box if someone enters letters instead of number, simply hits enter instead of making an entry, exiting on cancel. Now I need to have it loop if someone hits the space bar one time or more. Here is what I have:

Delta:    On Error GoTo ErrHandler1    Response = Application.InputBox(Prompt:=MyPrompt, Default:=MyPrompt2, _    Title:=MyTitle)    If Response = 0 Then GoTo Delta    Z = Response    If Response = Cancel Then    MsgBox ("You have chosen to exit the macro. Shutting down.")    Exit Sub    End If    If Response = False Then GoTo Delta    If Response = 0 Then GoTo Delta

View 9 Replies View Related

Stop Input Into Worksheet Based On Yes No Response

Mar 4, 2009

I am trying to work out how to stop input into a document if a certain response is selected from a form in excel 2007. Basically, i need some programming so if a question is answered a certain way - the user cannot continue completing the form as it becomes "locked" and an error box comes up saying this is the case - and what action needs to occur. As the list is a data validation list - i cant just separate it out - so that if one response is chosen over another then the error message appears.

For example the question might be "Will you use contractors". If the answer is Yes, the cell turns red and an auto response fills the cell (VBA has already been written into the document for this to occur). What i need additionally is an error box to come up saying "This audit cannot continue as a Minor Plan needs to be completed" and the rest of the questions responses say something to the same effect.

View 5 Replies View Related

Msg Box Response Is Ignored

Apr 26, 2009

I am trying to achieve a response from a msgbox which will either continue with the sub or exit. I think my code is right but it doesn't seem to work and just carrys on regardless.

View 6 Replies View Related

Response Log

Dec 17, 2007

I'm trying to find a formula I can use to figure response time. The working hours are 7:00 AM to 3:00 PM and I do not want to count the hours between 3:00 pm and 7:00 AM of the next day.

Example:

Cell A1 has the call in DATE 12/06/07 and cell B1 has the call in time of 10:00 AM.

Cell C1 has the response date of 12/07/07 and cell D1 has the time of 9:00 AM.

So what I need is a formula in cell E1 that would count from 10:00AM untill 3:00 PM on 12/6/07 then pickup the count on 12/07/07 at 7:00 AM and go untill 9:00 AM.

So in this Example the final response time would be 7 hours or 7:00.

View 9 Replies View Related

Select Only One Response

Aug 11, 2008

Trying to accomplish a bit of data validation...

4 cells
A1 B1 C1 D1

The only acceptable input for these cells in a 'x'
If I place an 'x' in any one of the four cells than the other three must be blank.

View 14 Replies View Related

Return A Blank Response

Jan 4, 2009

if cell a24 has nothing in it how can i make sure a77 is blank at the moment it returns a zero

View 2 Replies View Related

IF Formula Response Y Or N In Column

Jan 27, 2009

I would like a formula which will give a Y or N response in Column C.

If there is content in Column A or B the result should be Y.
If Columns A or B are empty the result should be N.

Example 1
Column A = 2
Column B = 0
Column C = Y

Example 2
Column = 0
Column = 0
Column = N

View 2 Replies View Related

Getting Formula To Remove 0 Response

Dec 14, 2012

I have this formula: =(CONCATENATE(COUNT('Master Report'!R8:R34)," ",IF(COUNT('Master Report'!R8:R34)>0,"Departments are over Action OI 50%","")))

when there is nothing to count, it places a 0. I want to to be blank. How can I achieve this.

View 5 Replies View Related

DropDown List Response Before Next If

May 10, 2006

Trying to Have a User Pick A response from the first drop down list before the second is activated and then after they choose from that list have an error message appear if the vlookup formula returns a #N/A. Here is the code in it's entirety the problem area is in the Elseif Pipe category Right now it doesn't bug but it also doesn't wait for a choice to be made it just spits out all the messages

Private Sub Worksheet_Change(ByVal Target As Excel. Range)

Dim Add As String, Size As String, Sch As String
With Range("c11:c52"). Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=MaterialList"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = False
End With

View 9 Replies View Related

Determine MsgBox Response

Sep 27, 2007

Private Sub CommandButton1_Click()
Dim hojaRES As Worksheet
Dim howMuch As Long

Set hojaRES = ThisWorkbook.Worksheets("Resultado")
howMuch = 0

If total.Value = "" Then
MsgBox "¿Are u sure u want a cero?", vbYesNo, "the total value is 0"
End If

End Sub

I need to set the value of howMuch to 0 if one selects YES and ask for a new entry if one selects no. How can I specify the behaviour in depending on what the user decides?

View 3 Replies View Related

Data In Two Cells Return Response In Third

Jul 30, 2014

I am trying to get Excel to search A1 and B1 for specific information and return a result in C1.

E.g. If A1 contains the text "Jumping Castle"
and
If B1 contains the text "4"
Then
C1 will produce text of "170"

But the formula must also detect and return a different amount if the information in B1 changes.

E.g. If A1 contains the text "Jumping Castle"
and
If B1 contains the text "7"
Then
C1 will produce text of "250"

View 5 Replies View Related

IF Multiple Cells To Give Set Response?

Oct 29, 2012

long time reader, 1st time poster:I have a spreadsheet which uses =F to give set responses i.e.

Cell H35= =IF((G7-G35)=0,"No Issue",IF((G7-G35)>=1,"System/Paperwork do not Match",IF((G7-G35)

View 3 Replies View Related

Searching For A Response From Specific Person

Apr 15, 2014

Is there a way to search responses from a specific Person? I think it was before the Mr Excel format change. Domenic was the responder.

View 2 Replies View Related

Initiating A Response When Entering Into A Cell

Mar 20, 2008

I have an Excel worksheet that when a user enters something into cell A1 I want to clear cells (b2:b20). If I use an object, I can attach a macro to it, but I don't want to use an object. I want to use an Excel cell and then when the user types into it, I want to perform an action.

View 9 Replies View Related

Email Error: Server Response Was Not Available

Dec 8, 2006

I found the below code in one of the posts and it was working fine uptill few days back. now, i get the error Run Time error '-2147220975(80040211) The message could not be sent to the SMTP server. The transport error code was 0x80040217. The server response was not available

Sub CDO_Send_Workbook()
Dim iMsg As Object
Dim iConf As Object
Dim wb As Workbook
Dim WBname As String
Application. ScreenUpdating = False
Set wb = ActiveWorkbook
WBname = wb. Name & " " & Format(Now, "dd-mm-yy h-mm-ss") & ".xls"
wb.SaveCopyAs "C:/" & WBname
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
iConf.Load -1 ' CDO Source Defaults....................

View 2 Replies View Related

Modules In VBA

Feb 26, 2009

Can i know how many modules can be used in a VBA Program

View 9 Replies View Related

Conditional Formatting With If Statement - Response Due Column

Mar 25, 2014

I created added conditional formatting to the Response Due column, to keep track of when response was due.

I only want the conditional formatting to be applied if the cell next to it is blank.

For example, the last one on my attachment is due 3/26/14 but I have already submitted a response (see column K)

What can I add so that only those dates next to a blank in column K get the conditional formatting?

Sample.jpg

View 2 Replies View Related

Sumproduct To Count Response Between Time Range

Mar 20, 2014

I need a sumproduct to count response times in between 1-2 hours. The response times are calculated from an 'initial referral date and time' and a 'actual response date and time' (the difference between refererral and response time be across several days) and are in the format below:

Time between intital and contact

00:22:37

00:00:01

00:08:46

I have tried several different formula, but I can't get excel to recognise the time range I need. Its just the bit in red i need sorted.

=SUMPRODUCT((MONTH(Referral!$H$2:$H$1048576)=4)*(Referral!$E$2:$E$1048576="Initial")*(Referral!J2:J1048576>1)*(Referral!J2:J1048576

View 3 Replies View Related

If Statement With Vlookup Does Not Pull Proper Response

Aug 9, 2006

I am building a template for a report. The report resides on the first sheet of the workbook and the subsequent sheets is where the user would paste the appropriate reports so that the formulas on the first sheet can pull the appropriate data. I have all my formulas working fine with one exception.

The data in question needs to be pulled from the sheet "Paste Adcap Report Here" and the column is AA. The common piece of data between the two sheets is in column C of the Adcap sheet and column B of the main report sheet. What I need to do is conduct a vlookup between the report sheet and the Adcap sheet using the account id's and then return either the date value in row AA or the word ongoing which would be those accounts which do not have a preset end date. So far a co-worker had been able to come up with the following:

=If(VLOOKUP(B16, 'Paste Adcap Report Here'!C:AA,25,0) >0,"cap","ongoing")

The code is a bit screwy as she had to leave early. The problem we encountered was the entry in column AA for a non-ending campaign. It is represented by two hypens (--). This is what tied her up. we could not figure out why the formula was returning an #n/a instead of the term "ongoing" when it encountered the (--). Again, if the formula pulls a (--) then the word "ongoing" needs to be displayed and if the formula pulls an actual date value then it needs to display this date.

View 6 Replies View Related

Display Cell Content To User & Act On Their Response

Oct 5, 2006

In which control of vba can I show output of my work to a user of the program? But there is a trick here. In the output form, I need to ask something to the user so that I can proceed. (I need to put a few labels and a text box in the output form)

View 9 Replies View Related

Dropdown List With User Response Type-in

May 18, 2007

I know how to create a basic dropdown list, but what I don't know (I don't even know if it is possible to do at all) is how to allow user type-in response if the "Other (please specify)" option is used.

Column A
Question 1. What type of report are you using?
Column B will contain

Type I Report
Type II Report
Other (please specify)

If Type I or II is chosen from the list, I don't want user to be able to change anything. But If the Other (please specify) option is selected I would like to give user an ability to type in type of the report he/she is using. Also, is there a way to have list options chosen based on another list response?

View 2 Replies View Related

Differentiate Macro Code Message Box Response

Apr 21, 2008

I need a macro to provide a message box with yes and no buttons - how do I get the macro to act in accordance with the button pressed by user?

View 2 Replies View Related

Class Modules?

Oct 14, 2008

I'm wondering about class modules and what they can be used for etc etc? i want to continue developing my VBA and feel that this area is the next step?

View 2 Replies View Related

Ignoring 1 Of Two Modules

Jan 28, 2010

I have managed to get it almost done with lots of help from here the last issue I have is this:

The module I want transferred is working the assigning of the macro within that module to the button is working, however, when it gets to the FillSalesSheet section it opens the said workbook but then jumps to the module and the FillSalesSheet in that.

Module 1 which I would like ignored on the newly formed workbooks looks like this: ...

View 14 Replies View Related

Removing Modules

Nov 16, 2006

It seems like I am asking a question at least once a day. I searched the net and forums and could not find an answer to this question. Thanks to everyone for the help I am making a lot of progress because all of you. Basically, I have a read-only workbook which the user gets a prompt to save as a new workbook for editing purposes. I have a autorun macro so now when the user opens their workbook, it contains my autorun macro. I do not want this. Is there a way to remove modules so that the users copy has no macro information?

View 9 Replies View Related

On Open Run Two Modules

Apr 16, 2008

I have two modules I wish to run when I open a workbook. The reason I have them as modules is they are required to be run manually, also.

Is it possible for me to set a Workbook_Open() sub that will run these two modules?

The modules names are Module1 and Module2.
The modules stipulate what sheets etc they have to act on, I only need the modules to be initiated.

View 9 Replies View Related

Web Queries In Modules

Aug 8, 2006

I'm trying to produce a spreadsheet that pulls infomation from different web pages throughout the day. It needs to pull quite a large amount of information from different web pages hence I wanted to produce a subroutine which could be called with different variables for each web page, i.e. url, field, destination, etc.

To actually produce the query I recorded a macro and then used the code it produced. I then changed the URL to url, a string variable which holds the urls of the pages. The destion address was changed to destination, a range variable to store the destionation location, and the webTable was changed to table also a string variable to store the table number. This is shown below.

With ActiveSheet.QueryTables.Add(Connection:= _
url, Destination:= destination)
.Name = "q?s=%5EFTSE&m=L_137"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True.............................

View 2 Replies View Related

Export All Modules

Feb 11, 2008

I had a search and look around, but couldn't find any information on how to quickly (automatedly) export all the modules in a workbook to text files.

View 3 Replies View Related

Delete All Modules

Apr 17, 2008

I was looking for code that actually deletes ALL modules in the VBA code after I terminate a particular program.

View 2 Replies View Related







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