PC Review


Reply
Thread Tools Rate Thread

Add records to sheets based on a variables table

 
 
Brice
Guest
Posts: n/a
 
      26th Dec 2007
How do I incorporate a Variables Table (see below) so that
records are added based on it?
>
> Names: Sheet Name:
> Robert a/c 1 Robert Cash
> Dilbert a/c 3 Dilbert Cash
> Eggbert a/c 2 Other Cash
> Sherbert a/c 1 Other Cash
>
> Also, instead of cell G2 as reference, I would like to identify the
> concatenation of cells F2 and G2 together, then vlookup for this output under
> "Names:" on the VariablesTable and add record to the corresponding "Sheet
> Name:".........is this possible? Thanks for all your help!
>
>
> "Bob Phillips" wrote:
>
> > Dim sh As Worksheet
> >
> > Set sh = Worksheets("CashEntry")
> > With Worksheets(sh.Range("G2").Value)
> > If .Cells(2, 3).Value = Empty Then
> > sh.Range("C2:P3").Copy
> > .Range("C2").PasteSpecial (xlPasteValues)
> > Else
> > sh.Range("C2:P3").Copy
> > .Cells(.Rows.Count, "C").End(xlUp).Offset(1, 0).PasteSpecial
> > Paste:=xlPasteValues
> > End If
> > End With
> >
> >
> >
> > --
> > ---
> > HTH
> >
> > Bob
> >
> >
> > (there's no email, no snail mail, but somewhere should be gmail in my addy)
> >
> >
> >
> > "Brice" <(E-Mail Removed)> wrote in message
> > news:E421FAFA-8470-4BB2-8D16-(E-Mail Removed)...
> > >I currently have (script below) macro which adds a record (from "CashEntry"
> > > sheet, cells $C$2:$P$3) to the bottom of a list (on another sheet
> > > ""CashTransferRecord") .
> > >
> > > My Request: I would now like the ability to add the record to one of four
> > > different sheets (instead of solely the "CashTransferRecord") based on a
> > > Variables Table (see below). So, the macro will identify the Name located
> > > in
> > > 'CashEntry" cell G2, then add the record to bottom of list onto the
> > > appropriate Sheet Name.
> > >
> > > Variables Table:
> > >
> > > Names Sheet Name
> > > Robert RobertCash
> > > Dilbert DilbertCash
> > > Q-Bert Q-BertCash
> > > Eggbert EggbertCash
> > >
> > >
> > > __________________________________
> > > Sub CopyPasteOntoDatabase()
> > >
> > > Sheets("CashTransferRecord").Select
> > > If Cells(2, 3).Value = Empty Then
> > > Worksheets("CashEntry").Range("$C$2:$P$3").Copy
> > > Worksheets("CashTransferRecord").Range("C2").PasteSpecial
> > > (xlPasteValues)
> > > Else
> > > Worksheets("CashEntry").Range("$C$2:$P$3").Copy
> > > Worksheets("CashTransferRecord").Range("C65000").End(xlUp).Offset(1,
> > > 0).Cells.PasteSpecial (xlPasteValues)
> > > End If
> > >
> > > End Sub


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
recursively retrieve records from 2nd table based on records from elsamiro2351 Microsoft Access Queries 1 9th Mar 2010 12:03 PM
Need to update records in a table based upon records in another ta Iram Microsoft Access Queries 2 17th Dec 2009 12:25 AM
Update records based on value of other records in same table =?Utf-8?B?U3RldmUgUw==?= Microsoft Access Queries 2 21st Feb 2007 07:33 PM
Choose query columns from a table based on records in a second table. Liz Camel Microsoft Access Form Coding 2 15th May 2004 03:32 AM
Deleting records based on records in another table Paul Fenton Microsoft Access Queries 1 23rd Aug 2003 10:28 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:20 PM.