MarkVrenken
asked on
Excel VBA update entire column after event
Dear experts,
Is it possible to update an entire column on another through vba? i'm using an activex control checkbox on the sheet. From which the code should fire
thanks in advance,
Mark
Is it possible to update an entire column on another through vba? i'm using an activex control checkbox on the sheet. From which the code should fire
thanks in advance,
Mark
If CheckBox1.Value = True Then
' Do it here
End If
End Sub
ASKER
I'm sorry i'm an idiot!
I didn't explain what i want very well. I will try to explain what my thougts are.
I have a sheet with a checkbox. when it is checked i set the value of a cell to 1. When it is unchecked the value is 13. For simplicity sake the cell is A1 of that sheet.
The column that i want to update is based on a function i wrote. Like this. i don't have the code on this computer so forgive me if the code isn't totally correct. see below the code
so when the checkbox is checked case else =1
and when the checkbox is unchecked case else = 13
So when i check/uncheck the checkbox i want to recalculate the column based on the above function. I hope you guys now can understand:)
thanks for your reply!
I didn't explain what i want very well. I will try to explain what my thougts are.
I have a sheet with a checkbox. when it is checked i set the value of a cell to 1. When it is unchecked the value is 13. For simplicity sake the cell is A1 of that sheet.
The column that i want to update is based on a function i wrote. Like this. i don't have the code on this computer so forgive me if the code isn't totally correct. see below the code
Function Quartertomonth()
select case month
case Q1
Quartertomonth = 1
case Q2
Quartertomonth = 2
case Q3
Quartertomonth = 3
case Q4
Quartertomonth = 4
case else
Quartertomonth = Workbooks("workbookExample").sheets("sheet1").Range("A1").Value
end select
end function
so when the checkbox is checked case else =1
and when the checkbox is unchecked case else = 13
So when i check/uncheck the checkbox i want to recalculate the column based on the above function. I hope you guys now can understand:)
thanks for your reply!
Where and how is "month" defined?
Where and how are "Q1" through "Q4" defined?
Where and how are "Q1" through "Q4" defined?
ASKER
And i must add the column is on another sheet than the checkbox!
ASKER
It is defined in a table/column
Month month numeric(this column is based on the function)
Q1 1
Q2 2
1 or 13
Q1 1
Q4 4
1 or 13
Q4 4
1 or 13
Q3 3
I want this because then i can include or exclude the blanks through the checkbox
Month month numeric(this column is based on the function)
Q1 1
Q2 2
1 or 13
Q1 1
Q4 4
1 or 13
Q4 4
1 or 13
Q3 3
I want this because then i can include or exclude the blanks through the checkbox
ASKER
Workbooks(WorkbookName).Sh eets("Deal s").Column s("B:B").C alculate i have tried this but it doesn't seem to really recalculate it....
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry for not being clear in the beginning. Luckily i found a solution of my own
But I am guessing that this is not as simple as it sounds...
The following code will copy column 1 of sheet1 to column 1 of sheet2
You can then program alterations in columns or sheet as nescessary.
Open in new window