Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Find(SPELER, LookIn:=xlValues) problem with hidden colloms!!!

Hallo,

somewere in the middle of my macro is the next part

Set C2 = Sheets("Spelers").Range("J2:J65000").Find(SPELER, LookIn:=xlValues)

If C2 Is Nothing Then
MsgBox ("lege cel")
Else
Range(C2.Address).Offset(0, -9).Value = ""

End If

THe function works oke BUT

If i Hide Collum "J" this part of the macro does't work anymore.. is the
correct?

And does anybody know a reason for this.. and a solution?

thanks for all the help.


Swingleft

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default Find(SPELER, LookIn:=xlValues) problem with hidden colloms!!!

hi Swingleft,

replace
Range(C2.Address).Offset(0, -9).Value = ""
by
Cells(C2.Row, 1) = ""

--
isabelle

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Find(SPELER, LookIn:=xlValues) problem with hidden colloms!!!

Hi Isabele,

what you wrote is a good help for the macro but it didn't solve the
problem..:-(

The problem is that when i hide the Collum "J"
the "Set C2..." line doesn't work
so the macro returns

"lege regel"

when i unhide the collum "J" the macro works fine..

so my question is..

is there a way to use the line

"Set C2 = Sheets("Spelers").Range("J2:J65000").Find(SPELER,
LookIn:=xlValues)"

with a hidden Collum.

gr.

Swingleft



"Swingleft" schreef in bericht
bel.net...

Hallo,

somewere in the middle of my macro is the next part

Set C2 = Sheets("Spelers").Range("J2:J65000").Find(SPELER, LookIn:=xlValues)

If C2 Is Nothing Then
MsgBox ("lege cel")
Else
Range(C2.Address).Offset(0, -9).Value = ""

End If

THe function works oke BUT

If i Hide Collum "J" this part of the macro does't work anymore.. is the
correct?

And does anybody know a reason for this.. and a solution?

thanks for all the help.


Swingleft

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 420
Default Find(SPELER, LookIn:=xlValues) problem with hidden colloms!!!

Try LookIn:=xlFormulas

ps. This line:

Range(C2.Address).Offset(0, -9).Value = ""

Works against either the activesheet or the sheet that owns the code (if the
code is in a sheet module).

If you want to change the cell on Spelers, you could use:

C2.Offset(0, -9).Value = ""





On 09/24/2011 17:02, Swingleft wrote:
Hallo,

somewere in the middle of my macro is the next part

Set C2 = Sheets("Spelers").Range("J2:J65000").Find(SPELER, LookIn:=xlValues)

If C2 Is Nothing Then
MsgBox ("lege cel")
Else
Range(C2.Address).Offset(0, -9).Value = ""

End If

THe function works oke BUT

If i Hide Collum "J" this part of the macro does't work anymore.. is the
correct?

And does anybody know a reason for this.. and a solution?

thanks for all the help.


Swingleft


--
Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default Find(SPELER, LookIn:=xlValues) problem with hidden colloms!!!



you can use the MATCH function, if it's whole value of a cell that is searched

With Sheets("Spelers")
nLine = .Range("J" & Application.Match(SPELER, .Range("J1:J65000"), 0))
.Cells(nLine, 1) = ""
End With

--
isabelle




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default Find(SPELER, LookIn:=xlValues) problem with hidden colloms!!!

also you can temporarily unhide the column,

Application.ScreenUpdating = False
With Sheets("Spelers")
..Range("J:J").EntireColumn.Hidden = False
Set c2 = .Range("J2:J65000").Find(SPELER, LookIn:=xlValues)
..Range("J:J").EntireColumn.Hidden = True
End With
Application.ScreenUpdating = False

--
isabelle



Le 2011-09-25 09:15, isabelle a écrit :


you can use the MATCH function, if it's whole value of a cell that is searched

With Sheets("Spelers")
nLine = .Range("J" & Application.Match(SPELER, .Range("J1:J65000"), 0))
.Cells(nLine, 1) = ""
End With

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default Find(SPELER, LookIn:=xlValues) problem with hidden colloms!!!

sorry, you have to put the second "Application.ScreenUpdating" to True

--
isabelle


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
.LookIn problem 2007 John[_19_] Excel Programming 5 December 4th 09 04:00 AM
How to test for valid 'Paste:=xlValues' before attempt. Bassman62 Excel Programming 2 December 11th 08 10:31 PM
Problem with setting a R / W property, FileSearch, LookIn chuckd Excel Programming 2 November 9th 06 03:31 PM
Complie Error with xlValues vincent_vega Excel Programming 1 July 15th 06 07:21 PM
How do I restore the LookIn, LookAt, SearchOrder in FIND [email protected] Excel Programming 4 November 10th 05 11:41 PM


All times are GMT +1. The time now is 01:27 PM.

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

About Us

"It's about Microsoft Excel"