97 vs 2000?

starl

Administrator
Joined
Aug 16, 2002
Messages
6,082
Office Version
  1. 365
Platform
  1. Windows
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

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
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
 
Upvote 0

Forum statistics

Threads
1,218,891
Messages
6,145,022
Members
450,586
Latest member
hehehihi2007

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
Back
Top