Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"Troy" wrote in message ...
I hope I can relay my problem cleary. I have 2 worksheets, the first sheet is a form where the user answers a few questions and inputs a lot of data. It looks something like this: 104-89-78 MARTIN 02/04/2004 02/01/2004 DEBORAH 07-55-20 LEWIS 111-21-56 HAMPTON Etc... Where I am having problems is having the data stored on the "Database" worksheet. I need to keep the focus on the FORM and not be jumping back and forth between the sheets. The "Database" worksheet will have several ranges, each range being named for the day the data is input. ex: Feb_02_2004 I can create the range name and save the first row of data but after that I am at a loss. Every time I save the data, it overwrites the previous row, never moving down to the next empty row and updating the range. I hope you can understand this. Thanks. Troy, not sure if you mean the form is the worksheet. Or you have a userform displayed? If it's a userform the code below may help you. Private Sub cbadd_Click() Application.ScreenUpdating = False '''This stops the jumping action Dim custrange As Range Dim a As Integer Set custrange = Worksheets("CustData").Cells(2, 1).CurrentRegion For a = 1 To custrange.Rows.Count''this will count to the first empty cell Next a With customerdata''This is my userform name custrange(a, 1).Value = UCase(.tblast.Text) custrange(a, 2).Value = UCase(.tbfirst.Text) custrange(a, 3).Value = .tbphone.Text custrange(a, 4).Value = UCase(.tbstreet.Text) custrange(a, 5).Value = UCase(.tbcity.Text) custrange(a, 6).Value = UCase(.tbstate.Text) custrange(a, 7).Value = .tbzip.Text custrange(a, 8).Value = .tbstartdate.Text custrange(a, 10).Value = .tbjob.Text End With End Sub As they say "HTH" Charles, who likes working with Excel and Learning more everyday. Thanks to all who share their knowledge. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Subtotals from Named Range on other worksheet | Excel Worksheet Functions | |||
Do not specify worksheet in a named range | Excel Discussion (Misc queries) | |||
Getting a named range to appear in another worksheet | Excel Discussion (Misc queries) | |||
named range not specific to worksheet | Excel Programming | |||
need help adding named range as new series to a graph | Excel Programming |