Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 1
Unhappy Need formula or VBA code to find integer

Please help. I need an Excel formula or a VBA code that will find the first (and only the first) integer greater than the number 10 in a set of numbers 1-26 A1:A26, any help would be very much appreciated. Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Need formula or VBA code to find integer

Hi,

Am Tue, 3 Jun 2014 13:47:39 +0100 schrieb jackie2828:

Please help. I need an Excel formula or a VBA code that will find the
first (and only the first) integer greater than the number 10 in a set
of numbers 1-26 A1:A26, any help would be very much appreciated. Thanks
in advance.


try:
=ADDRESS(MATCH(MIN(IF(A1:A2610,A1:A26)),A1:A26,0) ,1,4)
and enter the formula with CTRL+Shift+Enter


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Need formula or VBA code to find integer

On Tuesday, June 3, 2014 8:47:39 AM UTC-4, jackie2828 wrote:
Please help. I need an Excel formula or a VBA code that will find the

first (and only the first) integer greater than the number 10 in a set

of numbers 1-26 A1:A26, any help would be very much appreciated. Thanks

in advance.









--

jackie2828


Jackie please try this code.

Sub test()


For i = 1 To 26
If Cells(i, 1).Value = 10 Then
MsgBox Cells(i, 1).Address
Cells(i, 1).Select
End If
Next

End Sub
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Need formula or VBA code to find integer

I can't get Claus's formula to work. But here's a variant on Claus's suggestion: use this formula, also entered with Ctrl+Shift+Enter:

=INDEX(A1:A26,MIN(IF(A1:A2610, ROW(A1:A26),100)))

(It will show #REF! if there's no number 10 in the range.)

Howard

On Sunday, 22 June 2014 23:35:01 UTC+10, wrote:
On Tuesday, June 3, 2014 8:47:39 AM UTC-4, jackie2828 wrote:

Please help. I need an Excel formula or a VBA code that will find the




first (and only the first) integer greater than the number 10 in a set




of numbers 1-26 A1:A26, any help would be very much appreciated. Thanks




in advance.




















--




jackie2828




Jackie please try this code.



Sub test()





For i = 1 To 26

If Cells(i, 1).Value = 10 Then

MsgBox Cells(i, 1).Address

Cells(i, 1).Select

End If

Next



End Sub


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula, Macro, or VBA code to find and insert Keith Excel Worksheet Functions 3 October 2nd 09 09:21 PM
VBA code optimization - why using long instead of integer? Thao Excel Programming 4 August 28th 08 09:43 PM
adding an integer to a string in code pspyve[_8_] Excel Programming 2 August 15th 06 01:45 AM
Check if a value is an integer using VBA code Rayo K Excel Programming 5 August 3rd 06 10:42 PM
Find lowest missing integer in a column Casey[_109_] Excel Programming 2 June 19th 06 07:10 PM


All times are GMT +1. The time now is 02:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"