Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I have set up a little workbook that has three sheets in it. Sheet 1: is a suedo user form that the user enters data into formatted cells on the sheet. each cell that a user enters data into is named Sheet 2: Temp Table This sheet is a database sheet that has columns that correspond to each cell on the sheet 1. The data for this table comes from the user entering it into sheet 1 Sheet 3: Site Reading Log This sheet is the master log. The idea is that users would enter values into the 'form' on sheet one. Sheet 2 stores those values in a single row. Once the user clicks 'Submit' on SHeet 1, the code is suppsoed to copy the row from sheet 2, into the next available row in sheet three. now, this code below does this, but there is a problem. If i try to enter a new set of data, when i click submit, the code overwrites the data stored in the previous rows with the new data pasted. What i end up wiht is multiple rows, containing the same data. What i actually want is a list of all my data, each in its own row. Can any one help me with thsi problem? Code ------ Private Sub CmdSubmit_Click() Dim iRow As Long Dim ws As Worksheet Set ws = Worksheets("Site Reading Log") ' find first empty row in database iRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row Worksheets("TempTable").Range("DailyReadingEntry") .Copy ws.Cells(iRow, 1) End Sub -- Carlee |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
See your other thread.
You may want to make sure that all the data in DailyReadingEntry is filled in--then you don't have to worry about empty cells causing trouble: with Worksheets("TempTable").Range("DailyReadingEntry") if .counta(.cells) = .count then 'all the cells are filled in else msgbox "Please fill in all the cells! exit sub end if end with 'code to copy would go here. ================= ps. Debra Dalgleish has a similar worksheet "form" that does something close to what you're doing he http://www.contextures.com/xlForm02.html And she has another related procedure here (to print items from the database): http://www.contextures.com/xlForm03.html Carlee wrote: Hello, I have set up a little workbook that has three sheets in it. Sheet 1: is a suedo user form that the user enters data into formatted cells on the sheet. each cell that a user enters data into is named Sheet 2: Temp Table This sheet is a database sheet that has columns that correspond to each cell on the sheet 1. The data for this table comes from the user entering it into sheet 1 Sheet 3: Site Reading Log This sheet is the master log. The idea is that users would enter values into the 'form' on sheet one. Sheet 2 stores those values in a single row. Once the user clicks 'Submit' on SHeet 1, the code is suppsoed to copy the row from sheet 2, into the next available row in sheet three. now, this code below does this, but there is a problem. If i try to enter a new set of data, when i click submit, the code overwrites the data stored in the previous rows with the new data pasted. What i end up wiht is multiple rows, containing the same data. What i actually want is a list of all my data, each in its own row. Can any one help me with thsi problem? Code ------ Private Sub CmdSubmit_Click() Dim iRow As Long Dim ws As Worksheet Set ws = Worksheets("Site Reading Log") ' find first empty row in database iRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row Worksheets("TempTable").Range("DailyReadingEntry") .Copy ws.Cells(iRow, 1) End Sub -- Carlee -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to add data into a text file without overwriting existing data | Excel Programming | |||
Overwriting an existing Excel workbook | Excel Discussion (Misc queries) | |||
Overwriting existing data in an Excel worksheet using ADO.Net | Excel Programming | |||
Overwriting existing data in an Excel worksheet using ADO.Net | Excel Programming | |||
Overwriting an existing workbook without having to click yes in the prompt box | Excel Programming |