ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sheet1 Data Autometically Uploaded in Sheet2 (https://www.excelbanter.com/excel-programming/384797-sheet1-data-autometically-uploaded-sheet2.html)

Akash

Sheet1 Data Autometically Uploaded in Sheet2
 
Hi,

I have a Querry regarding Macros.

I have Two Sheets
In Sheet 1 i have Three Columns

A1. Item Name
B1. Item Qty
C1. Item Price

In Sheet 2 i have 4 Columns

A1. Item Name
B1. Item Qty
C1. Item Price
D1. Calculations

Now i want that as soon as the user enters the Data in Sheet1 it
should autometically gets uploads in the Sheet2.

Right Now i am using the following Formula in Sheet2.
=TRIM('Sheet1'!A1)
=TRIM('Sheet1'!B1)
=TRIM('Sheet1'!C1)

I want a Macro of the same as the Formula gets deleted by the
operators and then i had to sit for rectifying the Error in the Sheet.

Pls help me by providng the codes.

Thanks in Advance.

Akash Maheshwari


NOPIK

Sheet1 Data Autometically Uploaded in Sheet2
 
On 8 อมา, 10:33, "Akash" wrote:
Hi,

I have a Querry regarding Macros.

I have Two Sheets
In Sheet 1 i have Three Columns

A1. Item Name
B1. Item Qty
C1. Item Price

In Sheet 2 i have 4 Columns

A1. Item Name
B1. Item Qty
C1. Item Price
D1. Calculations

Now i want that as soon as the user enters the Data in Sheet1 it
should autometically gets uploads in the Sheet2.

Right Now i am using the following Formula in Sheet2.
=TRIM('Sheet1'!A1)
=TRIM('Sheet1'!B1)
=TRIM('Sheet1'!C1)

Try Worksheet events, like:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Column < 5 Then 'Assume, that you have 4 columns from A to D
Range(Worksheets("Sheet1").Range("A" & Format(Target.Row) & ":C" &
Format(Target.Row))).Copy Worksheets("Sheet2").Range("A" &
Format(Target.Row) & ":C" & Format(Target.Row)) 'You can use "A:C"
Range or, walk thru all .Areas
Range(Worksheets("Sheet2").Range("D" & Format(Target.Row))).Copy
Worksheets("Sheet1").Range("D" & Format(Target.Row)) 'If you want to
return your calculations in Column D. Use "D:D" again to avoid .Areas
processing
End If
End Sub


Akash

Sheet1 Data Autometically Uploaded in Sheet2
 
On Mar 8, 1:52 pm, "NOPIK" wrote:
On 8 อมา, 10:33, "Akash" wrote:

Hi,


I have a Querry regarding Macros.


I have Two Sheets
In Sheet 1 i have Three Columns


A1. Item Name
B1. Item Qty
C1. Item Price


In Sheet 2 i have 4 Columns


A1. Item Name
B1. Item Qty
C1. Item Price
D1. Calculations


Now i want that as soon as the user enters the Data in Sheet1 it
should autometically gets uploads in the Sheet2.


Right Now i am using the following Formula in Sheet2.
=TRIM('Sheet1'!A1)
=TRIM('Sheet1'!B1)
=TRIM('Sheet1'!C1)


Try Worksheet events, like:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Column < 5 Then 'Assume, that you have 4 columns from A to D
Range(Worksheets("Sheet1").Range("A" & Format(Target.Row) & ":C" &
Format(Target.Row))).Copy Worksheets("Sheet2").Range("A" &
Format(Target.Row) & ":C" & Format(Target.Row)) 'You can use "A:C"
Range or, walk thru all .Areas
Range(Worksheets("Sheet2").Range("D" & Format(Target.Row))).Copy
Worksheets("Sheet1").Range("D" & Format(Target.Row)) 'If you want to
return your calculations in Column D. Use "D:D" again to avoid .Areas
processing
End If
End Sub



Hi,

As per the solution suggests, the colde is not working.

I just copied the code and paste it into the View Code Area of Sheet2.

But its not working.

What should i do in this regard.

Akash




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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com