473,503 Members | 1,662 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Code for moving focus

3 New Member
Hi All,

I am trying to develop a form in Vb that stores data in perticular cells based macthing value to the row and colum values in a table.
I can get focus on the colum value of the table but need to move the focus from 6 colums to the right from the activecell.

How do i do this? Your help will be greatly appreciated.

Thank You in advance.

Vishwas
Apr 9 '07 #1
5 1333
Killer42
8,435 Recognized Expert Expert
I am trying to develop a form in Vb that stores data in perticular cells based macthing value to the row and colum values in a table.
I can get focus on the colum value of the table but need to move the focus from 6 colums to the right from the activecell.
Can you tell us what version of VB you are using, and what controls you are using?
Apr 9 '07 #2
nadahalle
3 New Member
Can you tell us what version of VB you are using, and what controls you are using?
i am using Vb in MS office (excel) 2003 , I am using text boxes and a command botton.

Thank You
Apr 9 '07 #3
Killer42
8,435 Recognized Expert Expert
i am using Vb in MS office (excel) 2003 , I am using text boxes and a command button.
In that case, you're not actually using VB - it's VBA. Similar, but not identical.

It sounds as though what you want to use is the Offset function (actually, I think it might be a method) to specify a location relative to the current cell..
Apr 9 '07 #4
nadahalle
3 New Member
Hi killer42

Mate i sincerely appreciate your help,

I am an accountant trying to figure out easier way of doing things on excel,
i found that focus from current cell to where you want by using for example a sample code as below.

If (SngBustype = "B/Tax") Then
ActiveCell.Offset(0, 3).Range("A1").Select
ActiveCell.FormulaR1C1 = CurAmount

Thank You
Vishwas
Apr 9 '07 #5
Killer42
8,435 Recognized Expert Expert
I am an accountant trying to figure out easier way of doing things on excel, i found that focus from current cell to where you want by using for example a sample code as below.

If (SngBustype = "B/Tax") Then
ActiveCell.Offset(0, 3).Range("A1").Select
ActiveCell.FormulaR1C1 = CurAmount
Glad to see you've got your solution. :)

Don't forget, you can combine things. For instance, you could (probably) have said...
Expand|Select|Wrap|Line Numbers
  1. ActiveCell.Offset(0, 3).Range("A1").FormulaR1C1 = CurAmount
to get the same effect without moving the focus.
Apr 9 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1744
by: Andi B | last post by:
Hi everyone. I have a quick question - if I have a form which refers to a javascript when its submitted using: <form name = "fred" onsubmit = "test()"> and this function creates a popup...
65
12506
by: Skybuck Flying | last post by:
Hi, I needed a method to determine if a point was on a line segment in 2D. So I googled for some help and so far I have evaluated two methods. The first method was only a formula, the second...
2
1042
by: Robert Boudra | last post by:
I am capturing the KeyPress event on a series of text boxes and checking for the presence of the CR character to move the focus to the next textbox in tab order. I'm able to do this using the...
6
7584
by: tlyczko | last post by:
I have a BeforeUpdate where I need to ensure that no matter what, the first four fields on the form (one text box, 3 combo box lists) have data entered in them before the user closes the form or...
0
7201
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7083
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7328
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7456
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5011
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3153
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.