Simple Worksheets update

K

KelvinVBA

Dear All

I am a VBA beginner, I will be very grateful if you can give me a VB
script for the following situation, cheers!
=========================================================
I have 2 worksheets, "Sheet1" and "Sheet2". Lets say, there are
columns and 2 rows in Sheet 1

SHEET
Apple
6
4
(8) <------ new input

If I input a new row (8) in Sheet 1, this can generate 3 new rows i
Sheet 2. This logic is in accumulated basis.

SHEET
Apple
6
6
6
4
4
4
(8) <------ new update
(8) <------ new update
(8) <------ new update
=========================================================

I will apply your given VBA script onto an action button in Excel. I
other words, data inputter need to press this button after each new ro
has been added in Sheet 1. Many many thanks!!!

Best Regards
Kelvi
 
M

mangesh_yadav

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Column = 1 And Target.Row > 1 Then

x = 3 * Target.Row - 4
Sheet2.Cells(x + 0, 1) = Target.Value
Sheet2.Cells(x + 1, 1) = Target.Value
Sheet2.Cells(x + 2, 1) = Target.Value

End If

End Sub

The above code should be in the module for sheet1 in your exampl
 

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

Similar Threads


Top