Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default updating data lists using macros

I have a big list of data that must be added to daily. Severa
different columns must be entered and then sorted by date. I want t
create a way to enter the required data on a "cover page" using
custom entry form. So I want to know how to make a macro do th
following:

user enters data into form, then clicks "Update" button with assigne
macro

Macro then:

takes the data from my form
enters it in the data base (which is located on a seperate sheet in th
file)
clears form for next entry

I can make it enter one row of data, but I don't know how to incremen
it to have it enter data on the last available row each time

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default updating data lists using macros

This code will copy row 1 of Sheet1 to the first free row on Sheet2 and than
clear row 1 on Sheet1.
This code presumes that there is always an entry in column A.
Change the sheet names to match your workbook. Adjust the copy row to
reflect your form.

'''''''''''''''''''''' Untested code. Should work.
Sub TransferData()
Dim lrow As Long

' first free row on Sheet2
lrow = Sheets("Sheet2").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).Row

' copy row 1 of Sheet1 to first free row on Sheet2
Sheets("Sheet1").Rows(1).Copy _
Destination:=Sheets("Sheet2").Cells(lrow, 1)

' clear row 1 on Sheet1
Sheets("Sheet1").Rows(1).ClearContents

End Sub
''''''''''''''''''''''''''''
hth
--

steveB

(Remove 'NOSPAM' from email address if contacting me direct)


"taniedzw " wrote in message
...
I have a big list of data that must be added to daily. Several
different columns must be entered and then sorted by date. I want to
create a way to enter the required data on a "cover page" using a
custom entry form. So I want to know how to make a macro do the
following:

user enters data into form, then clicks "Update" button with assigned
macro

Macro then:

takes the data from my form
enters it in the data base (which is located on a seperate sheet in the
file)
clears form for next entry

I can make it enter one row of data, but I don't know how to increment
it to have it enter data on the last available row each time.


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default updating data lists using macros

Hello,

I am a total beginner at this and know enough about excel to b
dangerous.. but I couldn't resist responding to your questions as I'v
just recently found what you may be looking for on this board. I'v
created a user form which is made of comboboxes and textboxes tha
enter data into a sheet I've named "METRO" The code pasted belo
searches for the next "empty" cell in METRO and enters the info plugge
into the form. See below:
Private Sub ADD_Click()

Dim r As Long
Dim ws As Worksheet
Set ws = Worksheets("METRO")
With ws
If .AutoFilterMode Then
If .FilterMode Then
.ShowAllData
End If
End If
End With
r = ws.Cells(Rows.Count, 5).End(xlUp).Offset(1, 0).Row
ws.Range("C" & r).Value = ComboBox1.Value
ws.Range("E" & r).Value = rngsw.Value
ws.Range("F" & r).Value = rngfail.Value
ws.Range("H" & r).Value = ComboBox2.Value
ws.Range("I" & r).Value = ComboBox3.Value
ws.Range("J" & r).Value = ComboBox4.Value
ws.Range("K" & r).Value = ComboBox5.Value
ws.Range("L" & r).Value = ComboBox6.Value
ws.Range("N" & r).Value = TotHH.Value
ws.Range("O" & r).Value = TotMM.Value
ws.Range("T" & r).Value = ComboBox7.Value
ws.Range("AA" & r).Value = ComboBox8.Value
ws.Range("AD" & r).Value = Timestart.Value
ws.Range("AE" & r).Value = Timeend.Value
ws.Range("M" & r).Value = ComboBox9.Value
ComboBox1.Value = ""
rngsw.Value = ""
rngfail.Value = ""
ComboBox2.Value = ""
ComboBox3.Value = ""
ComboBox4.Value = ""
ComboBox5.Value = ""
ComboBox6.Value = ""
TotHH.Value = ""
TotMM.Value = ""
ComboBox7.Value = ""
ComboBox8.Value = ""
Timestart.Value = ""
Timeend.Value = ""
ComboBox9.Value = ""
ComboBox2.SetFocus
End Sub

Hope this helps!

--
Message posted from http://www.ExcelForum.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Updating a workbook and macros Bing59 Excel Discussion (Misc queries) 0 January 12th 10 05:58 PM
Linking and updating mulitple lists Mark Excel Worksheet Functions 1 April 18th 08 04:34 PM
Updating Data in Validation Lists kivikatz Excel Worksheet Functions 7 April 8th 07 12:22 AM
macros not updating Mark Excel Worksheet Functions 0 January 24th 06 03:45 PM
Updating lists Prixton Excel Discussion (Misc queries) 4 April 3rd 05 10:42 PM


All times are GMT +1. The time now is 01:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"