Entering 1 line of data values that will show up in a second Sheet?

I

iomighty

Essentially. I am trying to enter 1 line of data on a worksheet. I the
want this data to reflect the corresponding journal entries

Example: (1 line of data entry, First Worksheet)

Quantity = 1

Unit Price = 100

Date = March 31, 2004


Second Worksheet: (What I am trying to Automate)

Column 1: Quantity
A1 = 1
A2 = 1

Column 2: Unit Price
B1 = 100
B2 = -100

Column 3: Date
C1 = 31-March-04
C2 = 31-March-04




Hi..has anyone done this before?

I have tried countless times to make this work, admitedly I am new t
using visual basic.

But what I am trying to do seems so simple but..

I have a Column of data on my Main worksheet that I want to reflect i
a Second worksheet but into two lines.

Example: In my Master worksheet I have a column of price which A1
$100

When I enter this data I want it to appear in a second worksheet but i
two rows, i.e. A1 through A2

It seems so simple but I can not get it to work.

Anyone encounter this,? Any suggestions would be greatly appreciated.
Even if you are unable to help I would like to express my appreciatio
for all of you who lend your knowledge to all of us.

Thank you in advance...Mat
 
C

Charles

iomighty

Here is somethig that might help.

Sub copy_cells()
Application.ScreenUpdating = False
Dim rng As Range
Dim i As Long
Dim qty, price
Dim mydate As Date
Dim lastrow
Set rng = Worksheets("sheet1").Cells(1, 1).CurrentRegion
For i = 1 To rng.Rows.Count
qty = rng(i, 1).Value
price = rng(i, 2).Value
mydate = rng(i, 3).Value
Worksheets("sheet2").Activate
lastrow = Range("a65536").End(xlUp).Offset(1, 0).Select
With ActiveCell
.Value = qty
.Offset(1, 0).Value = qty
.Offset(0, 1).Value = price
.Offset(1, 1).Value = price
.Offset(0, 2).Value = mydate
.Offset(1, 2).Value = mydate
End With
Next i
End Sub

Charle
 

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