ChuckDrago
Active Member
- Joined
- Sep 7, 2007
- Messages
- 470
- Office Version
- 2010
- Platform
- Windows
Hi everyone,
I have a worksheet that accepts scanned data from bar coded cards. The records are parts to be ordered and they include their responsible buyer.
I have provided additional functionality, whereby the data can be sorted by buyer, emails are sent to them with their allocated parts requirements and finally the data is uploaded to a Kanban Master File.
The method I used to allow users to select the required functionality is by a UserForm containing buttons to execute the required functions.
When instantiated, the worksheet places the focus on the first available row (below the header) and on the first column. The UserForm is not active and you can scan data without any problem. When finished scanning, there is a call button to display the form modeless and the user can start executing the varouis functions without a hitch.
However, if the user calls the UserForm before scanning, then the application behaves erratically (e.g. a scan attempt results in jumping to another worksheet, without any data collected). Now, if you call the UserForm before scanning and click on the first available cell before starting the scan then the data is collected OK.
I want to avoid the need for clicking on the starting cell. What I tried thus far is this code on the call to the UserForm:
<pre><code>
Sub CallPanel()
With CPanel
.StartUpPosition = 0
.Top = 450
.Left = 350
.Show Modeless
End With
Dim xRow As Integer
xRow = Range("C34").End(xlUp).Row
Range("C" & xRow + 1).Activate
End Sub
</code></pre>
The activation statement does not suffice to do the trick (it appears that the UserForm still has the focus). Any ideas?
As always, much obliged to all.
Chuck
I have a worksheet that accepts scanned data from bar coded cards. The records are parts to be ordered and they include their responsible buyer.
I have provided additional functionality, whereby the data can be sorted by buyer, emails are sent to them with their allocated parts requirements and finally the data is uploaded to a Kanban Master File.
The method I used to allow users to select the required functionality is by a UserForm containing buttons to execute the required functions.
When instantiated, the worksheet places the focus on the first available row (below the header) and on the first column. The UserForm is not active and you can scan data without any problem. When finished scanning, there is a call button to display the form modeless and the user can start executing the varouis functions without a hitch.
However, if the user calls the UserForm before scanning, then the application behaves erratically (e.g. a scan attempt results in jumping to another worksheet, without any data collected). Now, if you call the UserForm before scanning and click on the first available cell before starting the scan then the data is collected OK.
I want to avoid the need for clicking on the starting cell. What I tried thus far is this code on the call to the UserForm:
<pre><code>
Sub CallPanel()
With CPanel
.StartUpPosition = 0
.Top = 450
.Left = 350
.Show Modeless
End With
Dim xRow As Integer
xRow = Range("C34").End(xlUp).Row
Range("C" & xRow + 1).Activate
End Sub
</code></pre>
The activation statement does not suffice to do the trick (it appears that the UserForm still has the focus). Any ideas?
As always, much obliged to all.
Chuck