Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

complicated question

0

hi

I  would  anybody  has  answering  or adivce me  about  what  in  mind  

if  I  have  the  macro  brings  all  the  files  names  with  the  types  in  specific  sheet and  multiple  columns   and  with  different  extensions of  files   is  it  possible  create  icons  in  the  same  cell  based on  extension  it's   possible  do  that  based on system in windows  or  I  have  to  save  the  icons  in specific  directory  then  it  create  the  icons  based on extension  files  are  existed in any cell for  instance   if  I  have  file  extension in any  cell like  1.pdf  then  should  show PDF  icon in  the  same  cell next  to the  text   or next to  cell which  contain file  extension  and  hyperlink the  the icons  to  open  file 

any  advices  or  suggestions,please  ?  

Answer
Discuss

Answers

0
Selected Answer

Yes. It's possible. Here are some basics.

  1. Icons are pictures. You have lots of them in your PC but most of them are spread over many directories where the programs that need them can find them.
  2. You can display any picture in any cell. For that purpose you will need to know the picture file's address. You can use the existing addresses but you may find it easier to manage if you make copies of all the icons in one folder of your choice and use those copies in your program.
  3. You can dynamically select a picture depending upon any criterium, for example the contents or partial contents (file extension) of a cell.
  4. You can dynamically change the position of a picture on the worksheet, depending upon the content or partial content of a cell.
  5. None of the above relatees to Windows. All is can be controlled from an Excel workbook using VBA.

As you continue your planning, I suggest you pay special attention to the work flow. Don't plan on clicking any button to see action. Instead, your plan should be that the icons appear automatically as you select cells, pick items from drop-downs or enter key words or numbers.

So, for example, you start with creating a drop-down with file names. When the user selects a name a macro kicks in (a Worksheet_Change event occurs and that event triggers the macro) that shows an icon in a specified position. For the purpose of getting help, just ask for simple solutions of partial problems, like, how to display the icon, How to adjust its size to match the size of the cell, how to determine the display location dynamically, how to select a different icon for different selections.

In other words, start with the work flow to define questions. Then get the big picture before the detail.

Discuss

Discussion

thanks  
Hasson (rep: 30) Jun 1, '21 at 4:25 am
Add to Discussion


Answer the Question

You must create an account to use the forum. Create an Account or Login