Send Data From Userform To Two Different Sheets

Jun 17, 2006

I have a userform that enters data into a hidden sheet, and it works fine so far, but now one of my bosses would like another sheet that contains some lookup data for the form to be updated every time the form is used. I'm thinking I can handle the data in the lookup sheet automatically deleting the older data but I can't figure out how to send the data to two different sheets when the form is completed.

Private Sub CmdOK_Click()
If MsgBox("Are You Sure This Form Is Complete?", vbYesNo) = vbNo Then Exit Sub
Unload Me
ActiveWorkbook.Sheets("Plant Production").Activate
Range("A1").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = txtDate.Value
ActiveCell.Offset(0, 51) = txtTime.Value
ActiveCell.Offset(0, 1) = cmbPlant.Value..........................

View 5 Replies


ADVERTISEMENT

Send Data From Userform To Worksheet AND Send Userform Fields In Email?

Jul 12, 2014

I have used a database template from this site and changed it to suit my needs but I have a bit of a problem with some of the code. I know how to update the worksheet with the relevant userform text fields and in another project I did I have successfully sent userform text fields in the body of an email.

For this project I want to update the worksheet AND send an email at the same time. However, using the two pieces of code together is causing an error that I can't seem to solve (using my very limited vba knowledge!). The code I am working on is below and I have highlighted the line that is getting the error message. C

VB:
Private Sub cmdSubmit_Click() 'Submit new record
Dim ws As Worksheet, lRow As Long, Str As String [code]....

View 1 Replies View Related

VBA Code To Send Data To Different Sheets

Jan 13, 2010

creating workbook with macros or vba code. I have a workbook that has several sheets.

The first sheet (All Students) has a table / range of student information. There are several other sheets one for each teacher, that would contain the student information from first sheet for that teacher. Teacher name is in one of the columns on the first sheet(All Students). What I'm looking to to do is create a workbook that would contain all Students in first tab/sheet, data will be entered into first sheet by teachers.

When I click on any of the teacher tabs excel should get data from (All Students) tab / sheet and populate teacher sheet with data for that teacher based on teacher column in All Students. Any suggestion on how to create this workbook. I've attached a sample workbook with data. I would like to make sure data refreshes when I click on teacher sheet.

View 12 Replies View Related

Userform That Will Add Data To Specified Table And Send Email With Notification?

Feb 9, 2014

I need to make a userform that will add data to table placed (for example G12:H12), and if G13:H13 cells are written to next cells below (G14:H14). I would also want to receive auto email noticiation (or notofications by pressing another command_button) that someone add data with copied content of (G13:H13...G14:H14....) cells in email body.

View 1 Replies View Related

Send Data From UserForm Controls To Specific Cells/Ranges

Aug 30, 2006

I have been working on my spreadsheet for sometime now, so far when I run into a code problem I can figure it out using someone eles's post. However, I can't seem to figure this one out. I need to send data from a userform to specific cells on my spreadsheet based upon the users selection in combobox 1, and textbox 1.

Example: User selects customer name from Combobox1, and part number auto loads into textbox1 from the data sheet.

There are then 11 combobox's that can be clicked as the userform is updated. Once the user is finished, I need the answers from each combobox to transfer to the worksheet next to the referenced Combobox1 and textobox1.

I used the code that RoyUk posted to him, but have only been able to get the first combobox to copy to the sheet, the rest stay blank.

(Here is the code so far)

Private Sub CommandButton2_Click()
Dim ce As Range, srcRng As Range
Dim sYear As String, sMonth As String

sYear = UserForm3.ComboBox1.Text 'When combobox1 is loaded, use as reference#1
sMonth = UserForm3.TextBox1.Text 'When textbox1 is loades, use as reference #2
Set srcRng = Range("c2", Range("c65536").End(xlUp)) 'Search range on worksheet
For Each ce In srcRng

View 7 Replies View Related

Userform Data To Multiple Sheets

Nov 17, 2009

I have created this with text, command & list boxes with a view to creating an asset register.

So the options i have are premises, hardware, software & fixtures. I have tested so that these go onto 1 sheet ( at the moment all additions go to premises) but i require for it to go to there respective sheets i.e. a sheet for each asset.

But, due to inexperience with userforms and VB i don't know how to do this.

Also, how can i get a sequential number coming up for each asset on their respective sheets

View 2 Replies View Related

Send Userform Entries To Separate Worksheet?

Jul 1, 2013

I need the information that is entered in a userform to be sent to a separate worksheet. Each time a user fills out the form, I would like the information to be documented on the next completely open row (ex. first form goes in row 2 (column headings are in row 1), second form goes in row 3, etc.). I don't know a ton when it comes to VBA, but I believe I have the code figured out to search for the next open row. Column A will always have data in it.:

Code:
dim currentrow as range
set currentrow=Range("A1").end(xldown).offset(1,0).entirerow)

What I can't figure out is how to insert the information to the correct columns. Each column has a header to it, and I would like the data from the userform to be put in the relevant column each time it is filled out.

For example, if column A's header was "First Name" and columm B's header was "Last Name", each time the form is filled out, I would like the first and last name (which was entered in the form) to be inserted into those columns (with each form entry on a separate row).

I think there might be a way to use the intersect method to find the row/column combination I'm looking for, but I'm not exactly sure how to do it. Using the first name example from above, it would basically look for the intersection of "currentrow" and column A, and insert the value that is entered into the userform.

View 2 Replies View Related

Userform Upload Data Very Slowly To Sheets VBA?

Aug 15, 2014

Currently I have done userform which works fine. I have one issue:

Uploading data to sheets is extremely slow ( takes about 30 secs)

I suppose finding last row takes much of it. How to replace 'lastrow' concept?

[Code]......

View 7 Replies View Related

How To Have Single Userform Put Data Into Two Separate Sheets Within Same Workbook

Feb 25, 2014

Is it possible to have a single userform put data into two separate sheets within the same workbook.

I have a userform set up for entering client data into a quote register,with no problems ( sheet 1)

A1, A2, A3, A4, A5, A6, A7, A8, A9

What I would like is for the data to also go to sheet 2, where I have a form set up to print off for our technicians to take on site.

The problem will be that I would like the data A1, A2, A3, A4, A5, A6, A7, A8, A9 not to store on this sheet after it is printed, so the next set on entries , can be printed etc.etc

View 2 Replies View Related

Send Multipage Userform Checkbox Selections To Multiple Rows Of Category

Apr 17, 2014

I have a multipage wizard like userform that for each page has check box selection choices a user can pick from. The sample I've attached uses animal attributes for 2 animals. What I'd like to have is code that populates the worksheet with the animal under consideration (determined by the Frame Caption) in say A5, then populates the attribute selections made starting in B5 with no blank rows in between if they chose not to mark a checkbox.

So for animal one on page 1 of the multipage form, if the user selected attributes 1, 3, 4, and 6 and clicked the "NEXT" button on that page, animal one appears in A5 and then those attribute selections would be in B5, B6, B7, and B8. If the user then selected for animal 2 on page 2 of the multipage form, attributes 2 and 6 and clicked the "NEXT" button on that page, then animal two would appear in A9 with the selections appearing in B9 and B10.

I should mention that the number of rows in Table 1 may grow (or shrink) row size with additional rows added (or deleted) by the user. Not sure if it matters.

View 1 Replies View Related

Enable Macro Automatically - Then Send Send Email

Sep 7, 2008

I used Scheduled Task to set up my spreadsheet to open daily. I have the code with assistance to pull out the due date items and place them into an email.

I have come across XLSTART/AUTOEXEC/ACTIVATE...ETC...
But cannot figure out the code that will automatically "enabling macro" once Scheduled Task opens the spreadsheet?

Then once the macro runs, the email with the due dates, how can this auto send without user interaction?
(currently I would have to hit send)

I am trying to make the process totally automated to open the spreadsheet at a certain time, send the email with due dates and close the spreadsheet.

Following code in ThisWorkbook--

Private Sub Workbook_Open()
Check_Date_Send_Mail
End Sub
Code in Module1--

Option Explicit
Sub Check_Date_Send_Mail()
Dim wbBook As Workbook
Dim wsSheet As Worksheet
Dim rnDate As Range, rnValue As Range
Dim stAddress As String, stMsg As String
Dim stRecipient As String, stSubject As String
Dim stPost As String
Set wbBook = ThisWorkbook
Set wsSheet = wbBook.Worksheets("Sheet1")
With wsSheet
Set rnDate = .Range("d2:t23")
End With

View 9 Replies View Related

Send Keys Doesn't Send Command

May 16, 2007

We use proprietary software to connect to an oracle database. The proprietary software has its own login form. I connect to 4 or 5 different databases randomly throughout the day. I wrote a script that I thought would alleviate my login woes but it doesn't work. The login, password, and database info get sent to the form but they all end up on the login line. Instead of the tab character being sent, I get a Beep generated for each line of code that is supposed to send the tab key code. My code is below and is stored in a *.vbs file.

setwshShell =wScript.CreateObject("WScript.Shell")
wshShell.AppActivate "Title Of My Login Form"
wScript.Sleep 100
wshShell.SendKeys "My Login Name"
wScript.Sleep 500
wshShell.SendKeys "{TAB}"
wScript.Sleep 500
wshShell.SendKeys "My Password"
wScript.Sleep 500
wshShell.SendKeys "{TAB}"
wScript.Sleep 500
wshShell.SendKeys "Name of My Database"
wScript.Sleep 500
wshShell.SendKeys "{TAB}"
wScript.Sleep 500
wshShell.SendKeys "~"

View 8 Replies View Related

Press Button To Open Form For Data Entry And Then Send Matching Data To Another Sheet

May 5, 2009

Now that the calculations are working, with the press of a button, I need to be able to select a range of dates and copy all lines within the range to a seperate sheet with the desired name under the same headings they currently reside under. I have included some modified code that is being used in another spreadsheet that was created for me, but I do not pretent to understand all of it and I no longer work with the creator of the spreadsheet. How do I use a button to open the form for date selections and entering the name of the new sheet, and then use the start button on the form to begin the matching and copying to a new sheet? If there is an easier way I am all for that too.

View 14 Replies View Related

Send Data Between Other Office Programs

Jun 28, 2007

Is it possible to send the contents of a cell to outlook via VBA trigger?

View 14 Replies View Related

Send Data From Input Box To Another Worksheet

Aug 31, 2008

I have created a form for my work. And I have input boxes for users to add data that I would like to get stored in another worksheet. What is the vba code to send data for an input box to another worksheet at the bottommost empty row; first column.

Private Sub cmdAddData_Click()

' Collect user name, find the space between first and last names, and separate the names.
UserName = InputBox("Enter the Program Name.", "Program Name")
spaceLoc = InStr(1, UserName, " ")
firstName = Left(UserName, spaceLoc - 1)

View 9 Replies View Related

Send Each Individual Person Their Own Data - Create A New Tab

Aug 7, 2014

I have a list of data which i need to send to individuals. I can sort the data by person's name.

I need to send each individual person their own data. Instead of copying and pasting each person's data into a new tab for everyone, is there a quick way in excel that for each change in person's name (Column A), that it creates a new tab with all the data?

View 5 Replies View Related

Command Button To Send Data To Another Workbook

Feb 22, 2014

The data in 4 specific cells in C:UsersOfficeDropboxWB1 needs to (upon clicking command button) be copied to the next available blank cell in 4 specefic rows in C:usersOfficeDropboxWB2.

WB1 Specific Cells List
Sheet1!A4
Sheet1!Q7
Sheet1!N22
Sheet2!E3

Data from these cells are to be copied to the rows listed below respectively.

WB2 Destination Rows (Next available blank row)
Sheet1! Row B
Sheet1! Row D
Sheet1! Row F
Sheet1! Row J

I gather from reading other posts that sending this data within the same WB is fairly easy, is it easy to do between WB's though as i must have seperate WB's?

View 1 Replies View Related

If Multiple Criteria Match Send Data

Feb 22, 2014

I have two different workbooks. In workbook1 I have a table like below:

A
B
C

[Code]....

What I want to do is to create a drop down menu in workbook2 where I can select a name
and then see below what time that person is working each day of the week.

View 1 Replies View Related

Automatically Send Emails Using Excel Data

Sep 19, 2008

I have a spreadsheet showing MOT details of vehicles. The details include 'Customer', Vehicle Reg', 'MOT due date', 'email address'.

Basically.. I want a method that will check whether or not the MOT due date is in 28 days time (so exactly 28 days from now).. and if it is.. then I want to use the email address that is on the same row to send the person a standard notification.. and if possible.. include details of the Vehicle Reg.

View 9 Replies View Related

Send Mail On Last Day Of Every Month If Last Day Is Saturday / Sunday Send Mail On Thursday

Mar 11, 2014

I am trying to write a macro to send mail on every Friday and also on last day of every month. If the last day of the month falls on Saturday or Sunday then the macro should mail on Friday. I have written a separate macro to send a mail. I have also written to check day(ie Monday, Tuesday etc) of today. If today is Friday or month end i can send mail. I dont know how to tell the macro to send mail on friday if the month last date is saturday or sunday.

Sub done()
Dim Dat As Date, x As Integer, y As Date, sorry As String
Dim str As String
sorry = "Today is not friday or month end. So i cannot send mails"
str = WeekdayName(Weekday(Now()))

[Code] ........

View 1 Replies View Related

Execute A Data Download Every Ten Seconds Until There Is A Value In C11 And Then Send An Email And Close

Nov 13, 2008

All this macro is supposed to do is execute a data download every ten seconds until there is a value in C11 and then send an email and close.

What seems to be happening is that it downloads, emails, closes... but then in ten seconds the sheet reappears and does it all again.

View 13 Replies View Related

Write To 2 Sheets From Userform

Feb 17, 2014

I was given the code below which works for "sheet1",but when adapted it to write to sheet repairs as well, nothing writes to sheet "repairs", have tried different codes that works writing to 1 sheet , but am having trouble writing to both sheets from a macro,i know it can be done

[Code] .....

View 6 Replies View Related

One Userform For Multiple Sheets

Jun 23, 2009

I have workbook with 12 sheets in it. each sheet is identical except that they are for each month of the year. i am using a userform to enter the data into each sheet. Each sheet will have different data.

I want to be able to use the same user form on each sheet but still have them insert into the open sheet. Currently I am creating duplicates of the userform for each sheet but it gets VERY!!! tiresome and it is making the workbook VERY large (5 mb so far). For example. the first sheet is "april". i open the userform and enter the data into the userform. the userform enters the data into the sheet.

now i go to sheet "may". currently I open a userform in that sheet that looks exactly the same as the userform in sheet "april" but is a completely different userform. I want to be able to use the userform from sheet "april" in sheet "may" but when in sheet "may" it inserts into sheet "may".

View 7 Replies View Related

Created Userform And Command Button But Data Entry Not Allowed In Userform

Jul 16, 2012

I have created a userform and a command button to bring up the user form but when I click on the command button and the user form pops up I am not able to enter any data, the entire page freezes

This is the code

Private Sub CommandButtoncancel_Click()
unloadme
End Sub
Private Sub CommandButtonOK_Click()
With Workbooks("RETS results version 2.xlsm")

[Code] ......

View 1 Replies View Related

Input Userform - Write To Different Sheets

Jan 26, 2014

I create a input user form,that add data to a sheet. This user form put 4 kinds of data to the sheet, 2x text box, 1 comobox and date of the moment.

But based on what I select in the combo box that should be written to a specific(equal named) worksheet.

festival boekhouding 2.0.xlsm

View 3 Replies View Related

Value From Userform Saving In Sheets As Date

Apr 16, 2012

I have a problem with value's from a userform saving in the sheets as date's. In the userform i fill out e.g. 14-4-12

With the code beneath i save them in mij sheet.

Code:
Sheets("Containerlabels Afdrukken").Range("D6") = TextBox2.Value

When i save this in my sheet, it is saved as text. While i want to calculate with this value as a date, i would like to know how i can save this value as a date.

View 3 Replies View Related

Userform To Select Sheets For Printing?

Jan 19, 2013

user form that has a list box that only picks up visual worksheet (not hidden ones) and then allows the user to select which ones to print via check boxes.

View 5 Replies View Related

Use Userform And Hidden Sheets At The Same Time

Feb 1, 2013

Is there a way to use a userform and hidden sheets at the same time?

I want to limit the access to the information through a userform but my userform requires me to unhide the userform to show. Is there a way to go around this? Because the information might be misused if the user can simply close the form and have access to the information in the sheet.

View 3 Replies View Related

Userform To Use 2 Comboboxes To Hide Sheets

Jun 6, 2013

Let's say I have Sheet1-Sheet6. I also have combobox1 (with item 1, 2, & 3 as the list items) & combobox 2 (with items 1 & 2 as the list items).

If combobox1 = 1 & combobox2 = 1 then hide Sheets 2,3,4,5,6
if combobox1 = 1 & combobox2 = 2 then hide Sheets 1,2,4,5,6
If combobox1 = 1 & combobox2 = 3 then hide sheets 1,2,3,4,6
If combobox1 = 2 & combobox2 = 1 then hide sheets 1,3,4,5,6
If combobox1 = 2 & combobox2 = 2 then hide sheets 1,2,3,5,6
If combobox1 = 2 & combobox2 = 3 then hide sheets 1,2,3,4,5

I would like to also make both of these combo boxes required fields and to default text to say 'Select One...'

View 1 Replies View Related

Email Selected Sheets Via Userform

Apr 3, 2014

I am trying to set up something similar to the old "print dialogue" box whereupon the user presses a command button on the userform and all sheets within the work book are listed (eg:sheet1, sheet2 etc) The user can select any amount of sheets and and using "OK" outlook is fired up- pretty similar to Ron de Bruins code for email.

I have tried taking the print dialogue vba and stooping it at copy, then trying to gets Ron's code to continue- without success.

There are great bits of code I've seen for select tabs and selct sheets from listbox, but I have found none to email once selected.

View 4 Replies View Related







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