|
-
Aug 24th, 2001, 04:40 AM
#1
Thread Starter
Lively Member
Basic vba doubt
My friend wants to move the control from cell A1 to B1 in Excel when he clicks on a command button embeded inside the excel worksheet.
I understand that this is possible thru vba, but, im totally new to it. Can someone help my friend.
Another thing is, should i call the excel .xls file from vb to make it run? If yes, how do i do it
Thanx again
-
Aug 24th, 2001, 05:57 AM
#2
A good of figuring out how to do things in EXCEL or WORD (in code, that is) is to record a macro, doing the thing, and work on that. I record the code, which made focus switch from one cell to another, and it looked like this:
Tyr putting this code under command button, but remember to change the target value, so it fits into your program.
I'm not sure what you mean by your last question. But here goes. If you have created some code in VBA under EXCEL, you would need to run it by opening EXCEL, there is no need for VB here.
-
Aug 24th, 2001, 06:13 AM
#3
Fanatic Member
If you want to call the Excel spreadsheet from VB you can (by using the Excel object library), but as AIS_DK said, it's not necessary.
If you want to access the VBA Editor from Excel, it's under the Tools Menu. Tools -> Macro -> Visual Basic Editor.
If you decide to record one, you can switch between absolute and relative recording. The difference is: in absolute recording, if you move to cell B1, it codes it to move you to cell B1 from wherever you may be. With relative recording, if you move from A1 to B1, it codes it to move one cell to the right. It depends on what you want to achieve with your macro.
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
|
Click Here to Expand Forum to Full Width
|