ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macro + IF Function? (https://www.excelbanter.com/excel-discussion-misc-queries/212948-macro-if-function.html)

Gunti

Macro + IF Function?
 
Hi,
I'm extremely new to using macro's in excel. I haven't been able to do more
than recording one and simply editing it in the vb editor.

What i want is this. I have on sheet 1 six check boxes. What i want the
macro to do is this.

Checkbox 1 is checked

I want cell D66:D80 to become something i define (which i guess i could
record in excel).

If it's unchecked this has to be gone. When i check checkbox 2 it does
exactly the same.

So far it's not a big problem. However, now i want to check 2 (or 3) boxes.
For example.

Checkbox 1 checked - D66:D80 become my values
Checkbox 2 checked - It first checks if D66:d80 is empty, if it is. It puts
it's info on D66:D80, if it is not empty it puts the info in F66:F80.

(Checkbox 3 checked - It first checks if D66:d80 is empty, then if F66:F80
is empty, then it puts it at the closest possible empty range)

Idem Dito for Checkbox 3,4,5,6. It will have to handle a maximum of 4
checked checkboxes.

Any idea on how to do this?

Thanks for any effort put into this.

Greetz,
Gunti


Gunti

Macro + IF Function?
 
I have another question for anyone interested in helping.

How can i use the checkbox to use a different macro when it's checked or
unchecked? In this example: i want to delete the info when it's being
unchecked. And add the info to d66:d80 when it is checked.

Greetz,
Gunti

"Gunti" wrote:

Hi,
I'm extremely new to using macro's in excel. I haven't been able to do more
than recording one and simply editing it in the vb editor.

What i want is this. I have on sheet 1 six check boxes. What i want the
macro to do is this.

Checkbox 1 is checked

I want cell D66:D80 to become something i define (which i guess i could
record in excel).

If it's unchecked this has to be gone. When i check checkbox 2 it does
exactly the same.

So far it's not a big problem. However, now i want to check 2 (or 3) boxes.
For example.

Checkbox 1 checked - D66:D80 become my values
Checkbox 2 checked - It first checks if D66:d80 is empty, if it is. It puts
it's info on D66:D80, if it is not empty it puts the info in F66:F80.

(Checkbox 3 checked - It first checks if D66:d80 is empty, then if F66:F80
is empty, then it puts it at the closest possible empty range)

Idem Dito for Checkbox 3,4,5,6. It will have to handle a maximum of 4
checked checkboxes.

Any idea on how to do this?

Thanks for any effort put into this.

Greetz,
Gunti



All times are GMT +1. The time now is 04:54 PM.

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