• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Need VBA help (Excel macro)

jingramm

Senior member
I am trying to develop a simple macro that will extract data from a worksheet and transfer it to another sheet.

Both sheets are in the same Excel file.

For example,

let's say I have a form inside Excel like this:
25q3n20.jpg


How do I take what is check marked in row "User Interface Type" and extract "Web - Intranet" as well as "Y" into another sheet?

I need just the check marked.


And for the "User roles" row, since nothing is check marked, how do I ignore that?

Thanks
 
So this is actually in a user form and not a worksheet? Version? looks like 2007 or newer.

I suggest an Office forum. There are tons of them out there.
I do use vba now and then but basically never with user forms. Just to speed up repetitive work I have to do.
But in general if you have the name of the checkbox you can access it's value through

myCheckBox.Value
 
What is an office forum?
This is not really a form, it looks like one but it is just a worksheet where you can enter in values inside a box like you would with any cell
 
You don't need a macro for this. Simple cell links will do fine. You can use logic statements (if, or, and) to ignore blank values or do things with certain combinations.

=if(a1="","",do something here if not blank)
 
You don't need a macro for this. Simple cell links will do fine. You can use logic statements (if, or, and) to ignore blank values or do things with certain combinations.

=if(a1="","",do something here if not blank)

I will look into this option however I am almost required to develop the macro...

If I go with the macro route, any idea what the VBA should look like?
 
You don't need a macro for this. Simple cell links will do fine. You can use logic statements (if, or, and) to ignore blank values or do things with certain combinations.

=if(a1="","",do something here if not blank)

What if I need to test the entire row at once instead of individually?

Is there a way to do that using logic statements?
 
What if I need to test the entire row at once instead of individually?

Is there a way to do that using logic statements?

nested if statements.

=if(A1="Y",something,if(A3="Y",something else,""))

that will do "something" if A1 = "Y" and will do "something else" if A3 = "Y". If neither A1 nor A3 = "Y", then it will return a blank cell.
 
There's a crazy amount of things you can do in a cell without macros. You can also look things like sumproduct and sumif functions. Without seeing your spreadsheet, it is very difficult to help.
 
Back
Top