I can't make my VB commands to repeat..any suggetions?

M

Matt G

I wrote a line of commands in VB Editor for data that I enter i
"sheet1" to appear in "sheet2" in the exact order I want.


The Problem:

I want these commands to continue repeating as I continue to add dat
entries to "sheet1"

What am I missing? This appears so simple but I can't write a comman
line that will work.

Example:

Sub Duplicate1()
Range("M2").Select
ActiveCell.FormulaR1C1 = "=Entry!R[-0]C"
Range("M3").Select
ActiveCell.FormulaR1C1 = "=Entry!R[-1]C"
Range("M4").Select
ActiveCell.FormulaR1C1 = "=Entry!R[-2]C"
Range("M5").Select
ActiveCell.FormulaR1C1 = "=Entry!R[-3]C"
Range("M5").Select

Range("N2").Select
Selection.NumberFormat = "dd-mmm-yy"
ActiveCell = "=Entry!N2"
Range("N3").Select
Selection.NumberFormat = "dd-mmm-yy"
ActiveCell = "=Entry!N2"
Range("N4").Select
Selection.NumberFormat = "dd-mmm-yy"
ActiveCell = "=Entry!O2"
Range("N5").Select
Selection.NumberFormat = "dd-mmm-yy"
ActiveCell = "=Entry!O2"
Range("N5").Select

End


I want "sheet2" to continue in this format as I enter in rows of dat
on "sheet1"

I would appreciate any tips or advice.

Mb
 
I

ijb

Hi,
do you mean that every time you enter something into sheet1 you want it to
appear in sheet2 too?


--
If I've mis-understood the question please tell me.

HTH

ijb

Remove nospam from my e-mail address to talk direct

Not MCSD, MVP, TLA, P&P, PCMCIA, etc just trying to help
 
M

Matt G

Exactly,

That is exactly what I thought the code I wrote was going t
accomplish.

And since i have altered how I want the data to appear in sheet2 it i
not a simple linking function between sheets.

Any advice?

mb
 
M

Matt G

I tried sheet(array but that did not work. I will keep on trying.
appreciate the tips.

Mat
 
M

Matt G

Hi Mark,

I truely appreciate your input.

As for the the first question, the references are correct, it may not
appear that way at first glance becasue I am having the data enter into
a different order on my second sheet.

I am going to work with the "Worksheet_SelectionChange" procedure you
mention. The code I worte is very basic as this is my first attemtp at
VB after reading a couple of books and pouring over forums. We shall
see what transpires.

Matt
 
Top