-
-
Is this what you mean?[VBA]Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Sheet1.Range("B12") = Range("B" & Rows.Count).End(xlUp)
End Sub[/VBA] This is a 'worksheet event' and the code goes into the code module for Sheet2
You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you
The major part of getting the right answer lies in asking the right question...
Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.
-
Hi John
Yes and No. I've copied the code - now you said it is a worksheet code, (whatever that is), so I opened VB & copied it into the relevant sheet as opposed to in a "module" - is that right??? (Just to clarify, I've put it in the sheet that has the total in - not the sheet I need it transferred to).
Now, I've changed the sheet1 to the name of the sheet that I need the total to be put into - but it gives me an error - tried various ways of doing it without any luck.
What am I doing wrong? The sheet I need it to go into is named "Coverpage" - very original.
Oops, I didn't get the zip file, did you get chance to send it?
Thanks for your help (that's me)
-
-
Hi John,
It works, ( I had put it in the right place, but I had two workbooks open & got a little confused in the process).
It is typical South African summer thunderstorms at the moment & one is about to descend on me - rather than risk all our PCs I tend to shut them down, (lost LAN cards etc once before through lightning & yes I have got almost every form of protection you can think of - but when these storms hit, they hit).
Anyway as soon as the storm is over - I'll copy the script over to all the other pages & let you know. Can I wait till then to put a solved note on.
Thanks so much for your help. (read your profile - it sounds interesting).
-
-
My problem though is that I get stuck on things for a long time - not just for a while.
But having said that, I'm feeling quite chuffed with myself, Matt, John & Malcom helped me and from there I have learnt a huge amount in the last few days. I have now managed to get a workbook up and running with various scripts in that match and tranfer various fields of data all over the place - I tried it out last night with loads of entries in - all my fingers were crossed cause I'd changed the original scripts to modify them where I needed to & I was petrified that they would all bomb out on me - but all 48 scripts ran correctly.
Now don't burst my bubble and tell me that it would have taken all you guys about one hour to do it - I know that - but just over a week ago - I wouldn't have had an idea where to start - so I'm quite chuffed.
But I see that no-one has managed to tell me yet - how I can hide the password in a script - John doesn't think it can be done, (neither do I but hope springs eternal).
Thanks for the compliment & take care
Amanda
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules