Log In

Your email is not your username

Register

If you were a member of the old Bodybuilding.com forums and would like to reuse your previous username, you can request it below. We use your email only for registration and do not store it. For more information, please see our Privacy Policy.

Confirm your email

A registration code was sent to your email. Enter it here.

Welcome

You have successfully setup your account.

Sign in

Quick Navigation Bottom Misc
Forum
» Reps for Excel VBA assistance.
  1. Results 1 to 26 of 26
post 1676051273 01-28-2023, 06:23 PM
-
#1
  1. Maestro
  2. отличнo!
  1. Maestro
  2. отличнo!
  3. Join Date: Oct 2002
  4. Location: New Mexico, United States
  5. Posts: 58,400
  6. Rep Power: 203698

Reps for Excel VBA assistance.

So, I just wrote some code in VBA and made a simple search bar for a bunch of data in Excel. How do I save the VBA code WITH the worksheet so that its all one file that can be emailed to someone so they can use the search function?
post 1676051613 01-28-2023, 06:29 PM
-
#2
  1. Maestro
  2. отличнo!
  1. Maestro
  2. отличнo!
  3. Join Date: Oct 2002
  4. Location: New Mexico, United States
  5. Posts: 58,400
  6. Rep Power: 203698
Originally Posted By Anachron
Save As .xslm?
hm, I tried that. It saved everything, but the code.
post 1676052043 01-28-2023, 06:37 PM
-
#3
  1. Dogkrack
  2. Banned
  1. Dogkrack
  2. Banned
  3. Join Date: Jun 2019
  4. Posts: 14,820
  5. Rep Power: 0
Originally Posted By Anachron
Did you insert it as a Module?
im gonna insert my module into your mom's rectum
post 1676052163 01-28-2023, 06:38 PM
-
#4
  1. Destor
  2. Registered User
  1. Destor
  2. Registered User
  3. Join Date: Apr 2012
  4. Location: Alberta, Canada
  5. Age: 41
  6. Posts: 43,481
  7. Rep Power: 254906
Originally Posted By Dogkrack
im gonna insert my module into your mom's rectum
Goes to show you how versatile VBA is
post 1676052273 01-28-2023, 06:40 PM
-
#5
  1. Maestro
  2. отличнo!
  1. Maestro
  2. отличнo!
  3. Join Date: Oct 2002
  4. Location: New Mexico, United States
  5. Posts: 58,400
  6. Rep Power: 203698
Originally Posted By Anachron
Did you insert it as a Module?
that i'm unaware of....
post 1676052383 01-28-2023, 06:42 PM
-
#6
  1. imbored205
  2. 7 inches
  1. imbored205
  2. 7 inches
  3. Join Date: Jul 2011
  4. Location: San Jose, California, United States
  5. Age: 35
  6. Posts: 3,347
  7. Rep Power: 38731
ctrl+F
What comes around comes around
I want to believe
post 1676052393 01-28-2023, 06:42 PM
-
#7
  1. Destor
  2. Registered User
  1. Destor
  2. Registered User
  3. Join Date: Apr 2012
  4. Location: Alberta, Canada
  5. Age: 41
  6. Posts: 43,481
  7. Rep Power: 254906
Originally Posted By Anachron
Fuark, they have computers in beaverland?
Brah I’d run laps around you in excel with just the keyboard


LAPS
post 1676052543 01-28-2023, 06:45 PM
-
#8
  1. Maestro
  2. отличнo!
  1. Maestro
  2. отличнo!
  3. Join Date: Oct 2002
  4. Location: New Mexico, United States
  5. Posts: 58,400
  6. Rep Power: 203698
Originally Posted By Anachron
Fuark, they have computers in beaverland?



How did you create the code?

I.e. What was the first step?
Activated developer mode, insert>list box, right clicked on it in "design mode" and typed the code in the VBA field
post 1676052783 01-28-2023, 06:47 PM
-
#9
  1. ErnieMccracken
  1. ErnieMccracken
  2. Join Date: Nov 2013
  3. Posts: 100,061
  4. Rep Power: 330290
Does it work when you save it?

Remember that the default on everyone else's excel is no macros or vba modules permitted.
post 1676052793 01-28-2023, 06:47 PM
-
#10
  1. dingler
  2. Registered User
  1. dingler
  2. Registered User
  3. Join Date: May 2012
  4. Location: District Of Columbia, United States
  5. Posts: 8,920
  6. Rep Power: 53570
Follow the steps on this page, no virus srs

https://www.extendoffice.com/documen...20More%20items
no crew crew
post 1676053103 01-28-2023, 06:52 PM
-
#11
  1. Maestro
  2. отличнo!
  1. Maestro
  2. отличнo!
  3. Join Date: Oct 2002
  4. Location: New Mexico, United States
  5. Posts: 58,400
  6. Rep Power: 203698
Originally Posted By ErnieMccracken
Does it work when you save it?

Remember that the default on everyone else's excel is no macros or vba modules permitted.
well damn...thats a good point...Would they specifically need to have vba modules permitted? or having the Developer tab good enough?
post 1676053133 01-28-2023, 06:53 PM
-
#12
  1. BraddlesMcGee
  2. Registered User
  1. BraddlesMcGee
  2. Registered User
  3. Join Date: Dec 2011
  4. Age: 36
  5. Posts: 11,239
  6. Rep Power: 58176
It has to be in the spreadsheet otherwise it won't work on the spreadsheet. Go to VBA macros, Edit, or whatever it is, through the Excel menu and if you see if it exists as a code module. The execution starts in Main(), mane.
Nocrew crew

SS final perma ban request
https://forum.obnoxiousbrutes.com/showthread.php?t=184614323
post 1676053783 01-28-2023, 07:02 PM
-
#13
  1. OPGenesis
  1. OPGenesis
  2. Join Date: Mar 2015
  3. Posts: 34,772
  4. Subscribers: 3
  5. Rep Power: 305834
Remember when I had to do this meaningless type of work lmao.

Thank god those days are long behind me.
"I am a rational animal who occupies the intermediary position between angel and beast"

"The upper class is afforded their position by the collective burden the underclass must carry for them"


**Summer Walker Crew**
post 1676054153 01-28-2023, 07:07 PM
-
#14
  1. DomMJr
  2. Registered User
  1. DomMJr
  2. Registered User
  3. Join Date: Dec 2022
  4. Age: 56
  5. Posts: 7,380
  6. Rep Power: 23077
Why would you not use a search bar like this on the spreadsheet?

Use a macro button or something so it is easy to use.
post 1676054173 01-28-2023, 07:07 PM
-
#15
  1. Maestro
  2. отличнo!
  1. Maestro
  2. отличнo!
  3. Join Date: Oct 2002
  4. Location: New Mexico, United States
  5. Posts: 58,400
  6. Rep Power: 203698
Originally Posted By Anachron
Open Developer mode, Insert New Module, then copy and paste your code into the module.

Then save as xlsm.

damn not sure why thats not working. I right click on my project name, insert>module paste my code, save the file as xlsm, but when I close excel and open it, the module I created doesn't save.
post 1676054353 01-28-2023, 07:09 PM
-
#16
  1. OPGenesis
  1. OPGenesis
  2. Join Date: Mar 2015
  3. Posts: 34,772
  4. Subscribers: 3
  5. Rep Power: 305834
Originally Posted By Anachron
Time to hobomax?
Nah. Found meaningful work
"I am a rational animal who occupies the intermediary position between angel and beast"

"The upper class is afforded their position by the collective burden the underclass must carry for them"


**Summer Walker Crew**
post 1676054413 01-28-2023, 07:11 PM
-
#17
  1. Maestro
  2. отличнo!
  1. Maestro
  2. отличнo!
  3. Join Date: Oct 2002
  4. Location: New Mexico, United States
  5. Posts: 58,400
  6. Rep Power: 203698
Originally Posted By DomMJr
Why would you not use a search bar like this on the spreadsheet?

Use a macro button or something so it is easy to use.
well, its a ton of info that has almost identical values. I wanted to put something together that allowed them to partially type in text and a selected amount of options would appear.

Also, I know there's a way to make a search bar with Function Arguments array or whatever, but it take up a lot of "real estate" on the page having to essentially make a duplicate version of the data adjacent
post 1676054623 01-28-2023, 07:16 PM
-
#18
  1. DomMJr
  2. Registered User
  1. DomMJr
  2. Registered User
  3. Join Date: Dec 2022
  4. Age: 56
  5. Posts: 7,380
  6. Rep Power: 23077
sounds unintuitive if someone using it for the first time needs to know you type in a box for autofill

I'd preselect groups or something.
post 1676055123 01-28-2023, 07:24 PM
-
#19
  1. Maestro
  2. отличнo!
  1. Maestro
  2. отличнo!
  3. Join Date: Oct 2002
  4. Location: New Mexico, United States
  5. Posts: 58,400
  6. Rep Power: 203698
Originally Posted By DomMJr
sounds unintuitive if someone using it for the first time needs to know you type in a box for autofill

I'd preselect groups or something.
I mean, when the code is all there its simple enough;
post 1676055463 01-28-2023, 07:29 PM
-
#20
  1. DomMJr
  2. Registered User
  1. DomMJr
  2. Registered User
  3. Join Date: Dec 2022
  4. Age: 56
  5. Posts: 7,380
  6. Rep Power: 23077
Originally Posted By Maestro
I mean, when the code is all there its simple enough;
Just insert a macro button adjacent to this and put the code to run when you click it.
post 1676055723 01-28-2023, 07:33 PM
-
#21
  1. Maestro
  2. отличнo!
  1. Maestro
  2. отличнo!
  3. Join Date: Oct 2002
  4. Location: New Mexico, United States
  5. Posts: 58,400
  6. Rep Power: 203698
Originally Posted By Anachron
Dunno brah, it works for me.

Edit : I just tested it, just inserted as Module, saved the project as xlsm, closed Excel, opened project and it's there...
okay, here's step by step what I've been doing;

create the module:

paste the code in the module

select "no" when I ask to save as

then save as the .xlsm


is there anything else I may have missed?
post 1676055853 01-28-2023, 08:36 PM
-
#22
  1. Anachron
  1. Anachron
  2. Join Date: Aug 2015
  3. Posts: 16,256
  4. Rep Power: 684030
Originally Posted By Maestro
okay, here's step by step what I've been doing;

create the module:

paste the code in the module

select "no" when I ask to save as

then save as the .xlsm


is there anything else I may have missed?
I don't get that prompt... It takes me to the save window, and I select macro enabled workbook.

Is it really saving as xlsm?

What happens when you close and reopen?
post 1676055883 01-28-2023, 07:37 PM
-
#23
  1. CementPizza
  2. Registered User
  1. CementPizza
  2. Registered User
  3. Join Date: Jan 2002
  4. Posts: 49,096
  5. Rep Power: 271368
save the entire directory in a .zip
R.I.P. Hector Bluntz
I am sex yor butt.
Sick Duck Crew.
Stroke crew
Mortal Enema Crew.
Intent to penetrate Crew.
https://www.amazon.com/Best-Sellers-Kitchen-Dining-Potholders/zgbs/kitchen/678537011
post 1676055973 01-28-2023, 07:38 PM
-
#24
  1. BraddlesMcGee
  2. Registered User
  1. BraddlesMcGee
  2. Registered User
  3. Join Date: Dec 2011
  4. Age: 36
  5. Posts: 11,239
  6. Rep Power: 58176
It's telling you it is a Macro Free Workbook.

You need to enable macros, somewhere.

Edit: But it gives you the option to save with macro. Not so simple.
Nocrew crew

SS final perma ban request
https://forum.obnoxiousbrutes.com/showthread.php?t=184614323
post 1676056303 01-28-2023, 07:45 PM
-
#25
  1. Maestro
  2. отличнo!
  1. Maestro
  2. отличнo!
  3. Join Date: Oct 2002
  4. Location: New Mexico, United States
  5. Posts: 58,400
  6. Rep Power: 203698
Originally Posted By Anachron
Is it really saving as xlsm?
HAH!

This statement right here fixed the issue.

So, I already had the document saved as an .xlsx, so even though I was telling it to SAVE AS an .xlsm it kept defaulting to .xlsx because that was the initial extension as I was trying to override what I originally saved.

I don't know why it was doing this, but it was saving as a Chart.xlsm.xlsx, lol

anyway, crisis averted. Thanks for sticking through my Excel illiteracy.
post 1676056583 01-28-2023, 08:53 PM
-
#26
  1. Anachron
  1. Anachron
  2. Join Date: Aug 2015
  3. Posts: 16,256
  4. Rep Power: 684030
Originally Posted By Maestro
HAH!

This statement right here fixed the issue.

So, I already had the document saved as an .xlsx, so even though I was telling it to SAVE AS an .xlsm it kept defaulting to .xlsx because that was the initial extension as I was trying to override what I originally saved.

I don't know why it was doing this, but it was saving as a Chart.xlsm.xlsx, lol

anyway, crisis averted. Thanks for sticking through my Excel illiteracy.
Oh wow, I hate it when it does that, LOL.
Quick Navigation Top Misc
Bookmarks
Digg.com
Digg
del.icio.us
del.icio.us
Stumbleupon.com
StumbleUpon
Google.com
Google
Facebook.com
Facebook
Posting Permissions
  1. You may not post new threads
  2. You may not post replies
  3. You may not post attachments
  4. You may not edit your posts