97 vs 2000?

starl

Administrator
Joined
Aug 16, 2002
Messages
5,984
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
  2. MacOS
Your supposed to be able to enter data into a worksheet without making it active...
Is that a 2000 ability?
I have a prog I wrote basically in 2000. When I ran it in 97, it kept on erroring whereever I had it pasting to a non-active sheet. If I made the sheet active first, the probs went away.

or is something else going on?
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

XL-Dennis

Well-known Member
Joined
Jul 27, 2002
Messages
1,920
starl,

Without any code it's hard to explore :wink:

Kind regards,
Dennis
 

starl

Administrator
Joined
Aug 16, 2002
Messages
5,984
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
  2. MacOS
well, the entire prog is huge, but I'll paste a sample procedure. As you can see, I have to activate the worksheet - yes, i had to - it was the only way to avoid the error. Then it works fine till it gets to "Update Combobox" - which activates (it had to) another worksheet. When I return to the current macro, it messes up on the next line.. but that makes sense b/c I'm pasting to a specific cell.
But the earlier parts work off a named range.. and it worked fine when I ran it on my 2000...lemme test this again...ok, I'm losing it.. I used to run this code fine...and now it doesn't....am i just nuts?
anyway, here's the code:
Sub SelectCell(ByVal Sheetname As String, ByVal rnInputRange As String, ByVal tbValue As Object, ByVal NeedDownShift As Boolean, _
Optional ByVal tbDate As Variant, Optional ByVal tbDate2 As Variant, Optional ByVal cbValue As Variant, Optional ByVal tbShares As Variant)

Dim AmountRow As String, stAddress As String
Dim Address1 As String
Dim OffSetRow As Integer


Worksheets(frm_Input.Caption & Sheetname).Activate
If tbValue <> "" Then
Range(rnInputRange).Select
If NeedDownShift Then
Selection.Insert Shift:=xlDown
OffSetRow = -1
Else
OffSetRow = 0
End If

AmountRow = GetAddress(rnInputRange)
Range(AmountRow).Offset(OffSetRow, 0).Value = tbValue.Value
If Not IsMissing(tbDate) Then 'for incoming
Range(AmountRow).Offset(-1, -2).Value = tbDate.Text
End If
If Not IsMissing(tbDate2) Then 'for assets
Range(AmountRow).Offset(-1, -3).Value = tbDate2.Text
End If
If Not IsMissing(cbValue) Then
Range(AmountRow).Offset(-1, -1).Value = cbValue.Text
UpdateCombobox cbValue, frm_Input.Caption & "_IncomeDescriptions"
End If
If Not IsMissing(tbShares) Then
Worksheets(frm_Input.Caption & Sheetname).Activate
Range(AmountRow).Offset(-1, -2).Value = tbShares.Text
End If
End If

End Sub
 

Forum statistics

Threads
1,144,363
Messages
5,723,917
Members
422,527
Latest member
JayTheKaz

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top