Under a deadline - need help

braindiesel

Well-known Member
Joined
Mar 16, 2009
Messages
554
Office Version
  1. 365
  2. 2019
  3. 2010
Platform
  1. Windows
For some reason, when I use the
selection.value = named range.value line of code, I get TRUE instead of a number that I need for a VLOOKUP
When I rerun the line of code it works,

So, in absence of a better answer,

I want to have the code look to see if all of the values are numbers. If not then I wan to rerun the code a second time.

I cannot use do loop as if this doesn't work I will just be stuck in a loop/

What do I need to do with this
If Selection.Cells.Count <> Range("mySimplyAcctRev").Rows.Count Then

so that the first part verifies that each cell contains a number, not text?

Your help is really appreciated
 

Some videos you may like

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

Glory

Well-known Member
Joined
Mar 16, 2011
Messages
640
isNumeric(expression or variable to evaluate) returns true/false. So If IsNumeric(...).
 

Glory

Well-known Member
Joined
Mar 16, 2011
Messages
640
selection.value = named range.value should be returning either true or false depending on whether the selection equals your named range.

If selection.value = named range.value Then

Vlookup(selection.value, etc etc)

End If

?
 

braindiesel

Well-known Member
Joined
Mar 16, 2009
Messages
554
Office Version
  1. 365
  2. 2019
  3. 2010
Platform
  1. Windows
it seems to be working. Thanks for the help
 

Watch MrExcel Video

Forum statistics

Threads
1,123,492
Messages
5,601,994
Members
414,490
Latest member
Rip181

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
Top