Help Template & Database

G

Guest

I am very new with Macros but have grande expectations.

My workbook contains Template sheet that when key cells updated, summary
information auto populates lower section of Template.
I DESIRE & ENVISION
having a Macro button, within the template, that when pushed
1) prints template
2) Updates a Database 2nd wksheet within wkbook.
3) Auto saves information on the next blank available row
4) Deletes template data (returns template to blank condition)

I know this is multifaceted question but have faith possible.

Any assistance wud be most appreciated.

StevenT



There are apx 10 cells that I want a the database sheet within same w.b.
 
G

Guest

Ron, thanks for your reply
but
My Co has blocked any websight deemed "Freeware or Software Download"

Don't suppose you could post direct solution?

Brgds, Steven
 
R

Ron de Bruin

Hi Steve

There is a lot of info on that page
But here a small part

The template sheet in my example is named "Sheet1"
Change the cells in this line to yours
Range("a1:c10,e12:g17").Areas

The datbase sheet is named "Sheet2" in my example
Change that to your sheet name(2 time )

Copy the macro and function in a normal module (not a sheet module)

Sub copy_2_NextToEachOther()
Dim destrange As Range, smallrng As Range
Dim I As Integer, lr As Long
I = 1
lr = LastRow(Sheets("Sheet2")) + 1
For Each smallrng In Sheets("Sheet1"). _
Range("a1:c10,e12:g17").Areas
Set destrange = Sheets("Sheet2").Cells(lr, I)
smallrng.Copy destrange
I = I + smallrng.Columns.Count
Next smallrng
End Sub


Function LastRow(sh As Worksheet)
On Error Resume Next
LastRow = sh.Cells.Find(What:="*", _
After:=sh.Range("A1"), _
Lookat:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Row
On Error GoTo 0
End Function
 
G

Guest

Ron,

Your help has been just what I wanted.

Do you also have a suggestion on how to update or change previously recorded
data?


Brgds, Steven
 
R

Ron de Bruin

Do you have a column with unigue numbers in the database
that we can use to get the data from that row ? to a edit sheet

Bed time for me now, tomorrow after work i will help you further
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top