How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask Richard Your Own Question

Richard
Richard, Software Specialist
Category: Microsoft Office
Satisfied Customers: 16836
Experience:  Over 15 year experience resolving Microsoft Office Issues
Type Your Microsoft Office Question Here...
Richard is online now
A new question is answered every 9 seconds

Not sure if my question should be asked here under VBA or Excel.

Resolved Question:

Not sure if my question should be asked here under VBA or Excel. I'm trying to create a simple macro to look at a row of data, if there is a match in a cell to hide that specific column and then move on to the next cell in that same row. The macro would be executed from another sheet in the workbook. thanks.
Submitted: 9 months ago.
Category: Microsoft Office
Expert:  Richard replied 9 months ago.
Thank you for your question, my name is Richard.

you have made the question to the right place.

I can write the macro for you, but I need to see the Excel File.

Can you upload it to me using the following instructions.

- Click the following link: http://www.wikisend.com
- Upload the file to that website
- Once it is uploaded, the resulting page will display a "File ID" number.
- Please, give me that "File ID Number"

Also tell me the row to check and which value should be matched.

Thank you
Customer: replied 9 months ago.


Hi Richard, sorry I can't send the original, but I made a sample spreadsheet for you. Note the original spreadsheet has many more columns of data.


 


There might be a better way to do this, but the first row in the DATA sheet is the row that will need to be checked for the word AIR or VENDOR, if there is a match then hide that column. The Main sheet Is were the macro start buttons are. I also need this to work from Excel 2010.


 


The file id is 447058.


 


Thanks.

Customer: replied 9 months ago.


Oh I forgot to mention that row one will be hidden from view in the normal state prior to any macros being run, thanks

Expert:  Richard replied 9 months ago.
This is now done for you Rubin

The File ID is 262322

If you have any problems, or would like any additional information or assistance, please do not hesitate to let me know.

And if you can take a second to rate my service, that would be greatly appreciated.

Thank you
Customer: replied 9 months ago.


Richard, I think we must have miscommunicated, I need the columns to be hidden versus the rows, thanks.

Expert:  Richard replied 9 months ago.
No problem, I corrected this for you.

You can download it with File ID 651948

Let me know if you have any difficulties please

Customer: replied 9 months ago.


Richard, there is still something wrong, the unhide macro seems to be working, but the hide air and hide vendor is only partially working; only some of the columns that have these key words (AIR an Vendor) are being hidden, thanks.

Expert:  Richard replied 9 months ago.
Ruben

It hides the columns that the value is in.

You want all columns from A to J hidden? Then there is nothing displayed anymore on the worksheet.

Customer: replied 9 months ago.


Richard, here is a summary of how it should work.


 


If I select the HIDE AIR macro it should hide all columns that have the word AIR in row 1. (Column C,G and I)


 


IF I select the HIDE VENDOR macro I should hide all columns that have the word VENDOR in row 1 (columns A,B,D,E,F,H, and J).


 


Anything you can do to shorten the code would help since the real spreadsheet has about 100 columns.


 


Hope that helps.

Expert:  Richard replied 9 months ago.
ok, so Row 1 is also being checked.

I have added this and you can download it here

286528

I cannot shorten the code, it is all needed.

Let me know if you have any difficulties please

Customer: replied 9 months ago.


Richard only row 1 needs to be checked for the key words (AIR or Vendor depending on the macro), maybe this will shorten the code?

Expert:  Richard replied 9 months ago.
ok, it only shortens it by a couple of lines

You can download it with ID 104806

but the amount of code should not matter, it has no bearing on performance, considering the size of the Macro.

Customer: replied 9 months ago.


It works! Yeah! Last question before I give you an excellent rating, how many macro are being used? I see four in total ( macro2, HideAIR, HideVendor, UnhideAll), but I see code in all of them for that appears to be related to each. Thanks

Expert:  Richard replied 9 months ago.
Sorry, Macro2 was my development area, you dont need that one.

Just HideAIR, HideVendor and UnhideALL

These are the 3 that you need Ruben.

If you need anything else, please do not hesitate to let me know

Thank you
Richard, Software Specialist
Category: Microsoft Office
Satisfied Customers: 16836
Experience: Over 15 year experience resolving Microsoft Office Issues
Richard and 5 other Microsoft Office Specialists are ready to help you

JustAnswer in the News:

 
 
 
Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.
 
 
 

What Customers are Saying:

 
 
 
  • My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed. One Happy Customer New York
< Last | Next >
  • My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed. One Happy Customer New York
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
  • This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!! Alex Los Angeles, CA
  • Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult. GP Hesperia, CA
  • I couldn't be more satisfied! This is the site I will always come to when I need a second opinion. Justin Kernersville, NC
  • Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around. Esther Woodstock, NY
  • Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know. Robin Elkton, Maryland
 
 
 

Meet The Experts:

 
 
 
  • jstinehelfer

    Information Systems Manager

    Satisfied Customers:

    36
    A+ Comptia Certified computer repair
< Last | Next >
  • http://ww2.justanswer.com/uploads/JS/jstinehelfer/2012-6-6_215146_Pictureofme1.64x64.png jstinehelfer's Avatar

    jstinehelfer

    Information Systems Manager

    Satisfied Customers:

    36
    A+ Comptia Certified computer repair
  • http://ww2.justanswer.com/uploads/JA/JasonJames122/2011-12-16_135647_jasonjamesheadshotweb.64x64.jpg JasonJames122's Avatar

    JasonJames122

    Computer Enthusiast

    Satisfied Customers:

    0
    I manage all information systems (network of Windows PC's and servers with Microsoft Office products) for a small business
  • http://ww2.justanswer.com/uploads/JE/jessmagz/2012-6-6_18129_jm.64x64.jpg Jess M.'s Avatar

    Jess M.

    Computer Support Specialist

    Satisfied Customers:

    301
    Computer Software Specialist for more than 10 years
  • http://ww2.justanswer.com/uploads/CH/chutz747/2011-11-6_14231_me.64x64.jpg The-PC-Guy's Avatar

    The-PC-Guy

    Computer Manager

    Satisfied Customers:

    274
    20 years experience providing remote computer support
  • http://ww2.justanswer.com/uploads/SP/spherrod/2012-6-6_174244_1000852.64x64.JPG Steve Herrod's Avatar

    Steve Herrod

    Computer Support Specialist

    Satisfied Customers:

    125
    Trained in Microsoft Office from 2000 through to latest version 2010.
  • http://ww2.justanswer.com/uploads/SE/Seashore2011/2011-12-6_33418_111205223015.64x64.jpg Chris L.'s Avatar

    Chris L.

    Support Specialist

    Satisfied Customers:

    124
    Certified Expert with over 10 years experience.
  • http://ww2.justanswer.com/uploads/KR/krkljatorm/2012-6-24_153417_ITMiro.64x64.jpg IT Miro's Avatar

    IT Miro

    Computer Scientist

    Satisfied Customers:

    97
    Bachelor's Degree in Information Technology, Microsoft Certified Professional