Copy cell range with function

Closed
PGHTECH - Jan 21, 2010 at 03:50 PM
 WutUP - Jan 21, 2010 at 09:35 PM
Hello,

I am very new to writing formula's and macros with Excel.
I have created a spreadsheet that I am using to record information for computer equipment I build
I have a cell range that I use to enter information on PC cards I add, I have created a macro associated with a button that will copy and paste a new cell range when I want to add additional cards which keeps all of the formulas intact
I have created another macro that copies a wider range of cells to include all of the info I need to record per machine. my problem is that when it copies the cell range it does not copy the button that I have associated with my first macro. And even if it did, I don't think that it would dynamically adjust the formula to be associated with the new cell range it would have (meaning if I added a PC card to the 2nd machines new section, with the current formula in place it would just add one to the first machine since that is hard coded in the VB programming of the macro)

Is there a way do accomplish what I want to do with cell functions? I have a feeling that this is the only way to dynamically change the cell range value when things get copied.
If anyone has any ideas or suggestions I would appreciate any help provided

1 response

Not sure that I'm am clear on the explanation. But, instead of having two separate buttons, try inserting your first macro in a module then you can "call" macro one in just one set of instructions.

Here is a part of code that I have used in one of my macros to give you an example:

If Not IsEmpty(Range("C" & EndRow)) Then
Range("D3") = Range("C" & EndRow)
Else
Call Week2
End If
0