ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   copying vis basic formula in multiple column/cells (https://www.excelbanter.com/excel-programming/314819-copying-vis-basic-formula-multiple-column-cells.html)

kmf

copying vis basic formula in multiple column/cells
 
thankyou sharad & george

I am new to vis basic and I rewrote below what I am trying to accomplish. I
wonder if someone could explain further. I
rewrote below what I am trying to do.
I am using excel spreadsheets to track sales in a business. I enter sales
data each week onto a spreadsheet and was given the formula below to use so
it would
automatically be entered onto a invoice I created on a separate excel sheet.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "AP4" Then
Worksheets("$INV1").Range("$A$22").Value = _
Target.Value
End If
If Target.Address = "AP5" Then
Worksheets("$INV1").Range("$A$23").Value = _
Target.Value
I want to copy this or something that will work so it works in in multiple
columns that correspond to
past or future weeks. I will have to repeat this many times because of
different time periods and different customers . In other words if I enter
sales data for several products and several customers this week in several
coulmns it would go to the invoice and I
could print it print each one afer i entered the data for a particular
customer. I want to keep the data I entered for historical reasons and
want to enter next weeks data in a new column for that week, but it would
still go to the same invoice form since after I print it and clear the
values in the invoice for the next customer.
So as i enter sales data each week in each new
column I would like it to go to the same invoice form. Can i write a code or
copy a vis basic formula that will take into account the new columns
automatically so i do not have to code every cell, just as excel works when
you copy from cell to cell it adjusts the cell address. thanks for any help.

KMF
--
kmf

JulieD

copying vis basic formula in multiple column/cells
 
Hi kmf

i have a sample workbook that allows you to create an invoice and store the
information in a summary worksheet (as well as keep a copy of the invoice).
If you would like a copy to see if it is useful to you please email me
direct (julied_ng @ hcts dot net dot au) and i'll send it to you.

Regards
JulieD

"kmf" wrote in message
...
thankyou sharad & george

I am new to vis basic and I rewrote below what I am trying to accomplish.
I
wonder if someone could explain further. I
rewrote below what I am trying to do.
I am using excel spreadsheets to track sales in a business. I enter sales
data each week onto a spreadsheet and was given the formula below to use
so
it would
automatically be entered onto a invoice I created on a separate excel
sheet.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "AP4" Then
Worksheets("$INV1").Range("$A$22").Value = _
Target.Value
End If
If Target.Address = "AP5" Then
Worksheets("$INV1").Range("$A$23").Value = _
Target.Value
I want to copy this or something that will work so it works in in multiple
columns that correspond to
past or future weeks. I will have to repeat this many times because of
different time periods and different customers . In other words if I enter
sales data for several products and several customers this week in several
coulmns it would go to the invoice and I
could print it print each one afer i entered the data for a particular
customer. I want to keep the data I entered for historical reasons and
want to enter next weeks data in a new column for that week, but it would
still go to the same invoice form since after I print it and clear the
values in the invoice for the next customer.
So as i enter sales data each week in each new
column I would like it to go to the same invoice form. Can i write a code
or
copy a vis basic formula that will take into account the new columns
automatically so i do not have to code every cell, just as excel works
when
you copy from cell to cell it adjusts the cell address. thanks for any
help.

KMF
--
kmf





All times are GMT +1. The time now is 05:30 AM.

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