Help needed some basic stuff

surbharti

New Member
Joined
Apr 7, 2020
Messages
2
Office Version
  1. 2016
  2. 2013
Anybody tell me how to delete spaces from drop down list .
i did code like this:

with sh1.range("A2").validation
.delete
.Add type:xlvalidateList, AlertStyle:=xlValidAlertStop, operator:xlBetween, Formula:"=sheet2!AH2:AH1000"
.IgnoreBlank=True
.IncellDropDown=True
.InputTitle=""
.InputMessage= ""
.ShowInput= True
.ShowError= True

End With


Using this code i am getting blank in drop down, how to remove blank
Is there i need to do another loop
or need to select second range value and last used row in formula?

kindly help
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
I'm guessing that what you mean is that your data validation list contains blanks and this is presumably because your range sheet2!AH2:AH1000 has blanks. Instead of using a fixed range try using a dynamically named range (search Mr Excel if not sure how to create a dynamically named range) which will grow/shrink depending on the list of actual value sin your range.
 
Upvote 0
h
I'm guessing that what you mean is that your data validation list contains blanks and this is presumably because your range sheet2!AH2:AH1000 has blanks. Instead of using a fixed range try using a dynamically named range (search Mr Excel if not sure how to create a dynamically named range) which will grow/shrink depending on the list of actual value sin your range.
i thank you, this has been resolved
 
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,941
Members
449,094
Latest member
teemeren

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top