ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro that adds then deletes (https://www.excelbanter.com/excel-programming/284816-macro-adds-then-deletes.html)

Brian McGuire

Macro that adds then deletes
 
I have a workbook that has an entry spreadsheet and an actual data table sheet. The entry spreadsheet is used to enter new data into the table without having to have users access the table directly. I am doing this with a macro that adds the new data to the next open row. Each row has about 20 different data entry points

Sub AddData(

' Macro3 Macr
' Macro recorded 12/1/2003 by Brian McGuir

Sheets("input").Range("A20:AB20").Copy Destination:=
Sheets("database").Cells(Rows.Count, 1).End(xlUp)
.Offset(1, 0
End Su

The macro is exceuted by ctrl+a. The macro itself works fine, I just need some modifications

1) is there a way to add just a button on the toolbar, or possibly to a cell beneath the entry row in order to get the data adde
2)After the data has been added to the table, I would like the macro to erase the data entered in the input shee
3)I would like the color of the destination text and cell to be different once it has been added

Any help would be greatly appreciated. Thanks in advance

Brian

goepf[_7_]

Macro that adds then deletes
 

Brian,

1) show the "control toolbox" toolbar and there you find a comman
button to "draw" where you want.
then go to the properties and give that button an nice name an
description (caption)
then go to the code of the button and call your macro from there with
call AddData
and exit the design mode (button on the toolbar)

2) and 3) sorry I'm in a hurry..

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements

Brian McGuire[_2_]

Macro that adds then deletes
 
Thanks

I figured out point 2, but I could still use some assistance on changing the colors of the added text and cells. Any help on this would be greatly appreciated. Thank you

Bria

3)I would like the color of the destination text and cell to be different once it has been added


----- goepf wrote: ----


Brian

1) show the "control toolbox" toolbar and there you find a comman
button to "draw" where you want
then go to the properties and give that button an nice name an
description (caption
then go to the code of the button and call your macro from there with
call AddDat
and exit the design mode (button on the toolbar

2) and 3) sorry I'm in a hurry..


-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

~~Now Available: Financial Statements.xls, a step by step guide to creating financial statement


goepf[_9_]

Macro that adds then deletes
 

3) always the same colors? then I would do it with conditional
formatting. Thats an easy way. You check if the cell is empty and if
not you format how ever you want (background and font).


goepf wrote:
*Brian,

1) show the "control toolbox" toolbar and there you find a command
button to "draw" where you want.
then go to the properties and give that button an nice name and
description (caption)
then go to the code of the button and call your macro from there
with: call AddData
and exit the design mode (button on the toolbar)

2) and 3) sorry I'm in a hurry... *



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements


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

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