Hi,
If you write 'call Sheet2.replace' instead of call recplace you will be able
to call code from a diffrent sheet. Sheet2 !)
By the way, you can place you macro in a module instead of in an empty
sheet.
regards,
Lazzzx
"Zak" <(E-Mail Removed)> skrev i meddelelsen
news

FFE0FBC-E75C-45CB-9EC2-(E-Mail Removed)...
> Hi,
>
> thanks this worked but the problem is it only works when i assign the
> macro
> in the sheet with all the data. if i put the button in sheet 2, which is
> empty and where i want the button to be it doesnt work! maybe i need to
> put
> in a condition in the button code so that it works regardless of what
> sheet
> its in. also i found because i put in a condition 'find GIS' (in upper
> case)
> it only finds it if its in upper case, can i do it so the macro will find
> this word regardless of the case its in?
>
> thanks a lot.
>
> "FSt1" wrote:
>
>> hi
>> sorry about the other post. hit the wrong button.
>> try this....
>>
>> Private Sub CommandButton1_Click()
>> Call replace
>> End Sub
>>
>> regards
>> FSt1
>> "Zak" wrote:
>>
>> > I have tried many times to add my macro to a button but it does not
>> > work. I
>> > have tried both the control toolbox and the forms menu.
>> >
>> > I am in design view when i create the button, double click it to show
>> > the
>> > VBE, enter the below code, go back to the button coming out of design
>> > view
>> > but nothing happens! not even an error. same when i do it via the forms
>> > menu,
>> > i assign the button but nothing happens!!
>> > (replace is my macros name.)
>> >
>> > Private Sub CommandButton1_Click()
>> > Run "replace"
>> >
>> > End Sub
>> >
>> > please help. thanks.
>> >