Struggling with odd active cell behaviour

B

BrianG

I'm currently using a template with an associated macro which increments
a number them does a SaveAs to a temporary location for data entry. The
problem is that after the SaveAs I can't seem to activate the cell that
requires the first data entry. The cell appears to be selected but the
standard toolbar is active. If the first character entered is a "T",
the "Tools" pull-down menu opens, an "F" opens the "File" menu, etc.
I've tried all combinations of sheet and cell Activate and Select with
no luck. Any help would be appreciated. Sample of code is below.

Dim NewNum As Integer
Dim TB As Worksheet
NewNum = 0
Set TB = ThisWorkbook.Worksheets(1)

Application.ScreenUpdating = False
On Error GoTo BadNum
ChDrive wpath 'Change Drive to working drive
ChDir wpath 'Change directory to working path
Workbooks.Open filename:=("nextponum.xlt")
Range("A1") = Range("A1") + 1
NewNum = Range("A1")
ActiveWorkbook.Close SaveChanges:=True
ThisWorkbook.Activate
Sheets(1).Select
TB.Range("AB1") = "C" & NewNum
TB.Select
On Error GoTo 0
On Error GoTo BadTempFile
Application.ScreenUpdating = True
tFilename = Range("AB1") & "_tmp"
ChDrive tpath 'Change to temp folder drive
ChDir tpath 'Change to temp directory
ThisWorkbook.SaveAs filename:=tFilename, & _ FileFormat:=xlNormal,
ReadOnlyRecommended:=False
On Error GoTo 0

Worksheets(1).Activate
Range("E8:S8").Activate
Range("E8:S8").Select
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top