ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find (https://www.excelbanter.com/excel-programming/323331-find.html)

dallas

Find
 

Hi.

I want to find a number in "Worksheets(3)" in Range("A1:AE1000")
The number is the number in cell: Range("Blad1!A17")
Then i want to move 1 cell to the right and copy and paste....

If the number in Worksheets(3) dont exist the kod from "Else" is ok
but if the number exist there is wrong in raw
c.Select

can you help me?
I try to do like this...

Dallas


Sub findkomb()

Set c = Worksheets(3).Range("A1:AE1000").Find(What:=Range( "Blad1!A17"),
LookIn:=xlValues, LookAt:=xlWhole)
If Not c Is Nothing Then
c.Select

ActiveCell.Offset(0, 1).Select
Selection.Copy

Sheets("Blad1").Select
ActiveSheet.Unprotect Password:="xxxxxx"
Range("B2").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False
Application.CutCopyMode = False
ActiveSheet.Protect Password:="xxxxxx"

Else

Sheets("Blad1").Select
ActiveSheet.Unprotect Password:="xxxxxx"
Range("B2") = "00000!"
ActiveSheet.Protect Password:="xxxxxx"
End If

End Sub


--
dallas


------------------------------------------------------------------------
dallas's Profile: http://www.excelforum.com/member.php...o&userid=10040
View this thread: http://www.excelforum.com/showthread...hreadid=345991



All times are GMT +1. The time now is 07:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com