Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy non-coun. cell
It seems to me that you've got two issues:
(1) to detect when your printing invoice, and (2) to copy data from one sheet into another. I suspect there may be a way to detect the "print" command, as you can set Excel to recompute the sheet prior to printing, but I don't know how to accomplish same. An alternative approach would be to write a macro that then becomes your "print" command. Early in said macro there would be code to open a dialog box to ask you if you want to transfer data. If the reply is to the affirmative, it executes the transfer data code. If the replay is to the negative, it bypasses the transfer data code. To copy the data your can use VBA commands something like: Worksheets("register").Cells(ActiveCell.Row, 1).Value = _ Worksheets("data").Cells(ActiveCell.Row, 4).Value sd wrote: I have created a Invoice in Sheet1 with the vlookup function where i copy address from sheet2. I want to create a register where i can transfer a data from Sheet1 to Register Sheet Inovice no., Invoice Date, Name of Party & Grant total. Which i am doing mainually. Is there any way that when i print invoice it should ask me that do you want to transfer data into Rgister sheet with yes & no. If i press yes it should copy data i.e. from cell a5,d10,a10 & h35 (Invoice No.,Invoice date, name of party & Grant total) in to register sheet and print Invoice & if no that it start printing invoice only. When i print 2nd invoice it should copy into next row of rgister sheet. Is there any help. plz help me Thanks in advance. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy non-coun. cell
You can put some code in the ThisWorkbook module to do anything you
want. You can either write the the full code here or call a regular macro. Private Sub Workbook_BeforePrint(Cancel As Boolean) * your code* End Sub -- sb "sd" wrote in message ... thanks for reply what i want is when i print a invoice at that time only i want that data into register. is any more help for macro? Thanks -----Original Message----- It seems to me that you've got two issues: (1) to detect when your printing invoice, and (2) to copy data from one sheet into another. I suspect there may be a way to detect the "print" command, as you can set Excel to recompute the sheet prior to printing, but I don't know how to accomplish same. An alternative approach would be to write a macro that then becomes your "print" command. Early in said macro there would be code to open a dialog box to ask you if you want to transfer data. If the reply is to the affirmative, it executes the transfer data code. If the replay is to the negative, it bypasses the transfer data code. To copy the data your can use VBA commands something like: Worksheets("register").Cells(ActiveCell.Row, 1).Value = _ Worksheets("data").Cells(ActiveCell.Row, 4).Value sd wrote: I have created a Invoice in Sheet1 with the vlookup function where i copy address from sheet2. I want to create a register where i can transfer a data from Sheet1 to Register Sheet Inovice no., Invoice Date, Name of Party & Grant total. Which i am doing mainually. Is there any way that when i print invoice it should ask me that do you want to transfer data into Rgister sheet with yes & no. If i press yes it should copy data i.e. from cell a5,d10,a10 & h35 (Invoice No.,Invoice date, name of party & Grant total) in to register sheet and print Invoice & if no that it start printing invoice only. When i print 2nd invoice it should copy into next row of rgister sheet. Is there any help. plz help me Thanks in advance. . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Options | Excel Discussion (Misc queries) | |||
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing | Excel Discussion (Misc queries) | |||
How can I copy a value from a cell and paste it into another cell while adding it to the previous value in that cell | Excel Worksheet Functions | |||
I copy a formula and the results copy from the original cell | Excel Discussion (Misc queries) | |||
coun if | Excel Worksheet Functions |