Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
cg cg is offline
external usenet poster
 
Posts: 6
Default ok in 2000 not in 97

I have a user form with a list box. It has 3 columns and
has a named range as its rowsource. When the user double
clicks an item in the listbox, it deletes the row and
bring up a user form with the information populated. The
user can then save the info back to the sheet. It will be
place in the next empty row. This works fine in 2000 but
when I took it to work where I have 97 it does not.
The 'update' info is not refelected back in the listbox?
I also started getting a message that excel has generated
error and will close. (not sure if that is related) Belwo
is the code I have. If anyone has any ideas where I am
going wrong, I would be most greatful.

Private Sub lbPending_DblClick(ByVal Cancel As
MSForms.ReturnBoolean)

ufEntry.Hide

'when an item is double clicked in the 'pending
transactions' listbox
'bring up the create userform and populate with the
entries made so far

Dim Rowcnt As Long
Dim r As Long

Rowcnt = 0
RemoveDuplicates

For r = 0 To lbPending.ListCount - 1
If lbPending.Selected(r) Then

Rowcnt = r + 2 'listcount begins with 0 and row 1 is
headings so we add 2
'to match the row # with the listindex
#
Dim how As String
how = Sheet2.Range("a" & Rowcnt).Value
Select Case how
Case "ebuy"
ufCreate.obebuy.Value = True
Case "PS7381"
ufCreate.ob7381.Value = True
Case "NA"
ufCreate.obNA.Value = True
End Select

Sheet2.Columns("B:B").EntireColumn.Hidden = False
ufCreate.tbApprovalDate.Value = Sheet2.Range("b" &
Rowcnt).Text
Sheet1.Columns("B:B").EntireColumn.Hidden = True


ufCreate.tbOrderDate.Value = Sheet2.Range("c" &
Rowcnt).Text
ufCreate.tbDescription.Value = Sheet2.Range("d" &
Rowcnt).Text
ufCreate.cbCatagory.Value = Sheet2.Range("e" &
Rowcnt).Text
ufCreate.cbVendor.Value = Sheet2.Range("f" &
Rowcnt).Text
ufCreate.tbInvoiceNum.Value = Sheet2.Range("g" &
Rowcnt).Text
ufCreate.tbReceiveDate.Value = Sheet2.Range("h" &
Rowcnt).Text
ufCreate.tbPaidDate.Value = Sheet2.Range("i" &
Rowcnt).Text
ufCreate.cbMethod.Value = Sheet2.Range("j" &
Rowcnt).Text
ufCreate.tbCost.Value = Sheet2.Range("k" &
Rowcnt).Text

'Now remove the transaction form the pending list
Sheet2.Range("a" & Rowcnt).EntireRow.Delete

End If
Next r

ActiveWorkbook.Names.Add Name:="lbPendingList",
RefersToR1C1:= _
"=PendingLog!R2C3:R40C5"

ufCreate.Show

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default ok in 2000 not in 97

I have found that deleting something in the rowsource in Excel 97 causes a
crash.

I would try

set rng = Range(lbPending.RowSource)
lbPending.RowSource = ""
Sheet2.Range("a" & Rowcnt).EntireRow.Delete
lbPending.RowSource = rng.resize( _
rng.rows.count-1).address(external:=True)

--
Regards
Tom Ogilvy

cg wrote in message
...
I have a user form with a list box. It has 3 columns and
has a named range as its rowsource. When the user double
clicks an item in the listbox, it deletes the row and
bring up a user form with the information populated. The
user can then save the info back to the sheet. It will be
place in the next empty row. This works fine in 2000 but
when I took it to work where I have 97 it does not.
The 'update' info is not refelected back in the listbox?
I also started getting a message that excel has generated
error and will close. (not sure if that is related) Belwo
is the code I have. If anyone has any ideas where I am
going wrong, I would be most greatful.

Private Sub lbPending_DblClick(ByVal Cancel As
MSForms.ReturnBoolean)

ufEntry.Hide

'when an item is double clicked in the 'pending
transactions' listbox
'bring up the create userform and populate with the
entries made so far

Dim Rowcnt As Long
Dim r As Long

Rowcnt = 0
RemoveDuplicates

For r = 0 To lbPending.ListCount - 1
If lbPending.Selected(r) Then

Rowcnt = r + 2 'listcount begins with 0 and row 1 is
headings so we add 2
'to match the row # with the listindex
#
Dim how As String
how = Sheet2.Range("a" & Rowcnt).Value
Select Case how
Case "ebuy"
ufCreate.obebuy.Value = True
Case "PS7381"
ufCreate.ob7381.Value = True
Case "NA"
ufCreate.obNA.Value = True
End Select

Sheet2.Columns("B:B").EntireColumn.Hidden = False
ufCreate.tbApprovalDate.Value = Sheet2.Range("b" &
Rowcnt).Text
Sheet1.Columns("B:B").EntireColumn.Hidden = True


ufCreate.tbOrderDate.Value = Sheet2.Range("c" &
Rowcnt).Text
ufCreate.tbDescription.Value = Sheet2.Range("d" &
Rowcnt).Text
ufCreate.cbCatagory.Value = Sheet2.Range("e" &
Rowcnt).Text
ufCreate.cbVendor.Value = Sheet2.Range("f" &
Rowcnt).Text
ufCreate.tbInvoiceNum.Value = Sheet2.Range("g" &
Rowcnt).Text
ufCreate.tbReceiveDate.Value = Sheet2.Range("h" &
Rowcnt).Text
ufCreate.tbPaidDate.Value = Sheet2.Range("i" &
Rowcnt).Text
ufCreate.cbMethod.Value = Sheet2.Range("j" &
Rowcnt).Text
ufCreate.tbCost.Value = Sheet2.Range("k" &
Rowcnt).Text

'Now remove the transaction form the pending list
Sheet2.Range("a" & Rowcnt).EntireRow.Delete

End If
Next r

ActiveWorkbook.Names.Add Name:="lbPendingList",
RefersToR1C1:= _
"=PendingLog!R2C3:R40C5"

ufCreate.Show

End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
cg cg is offline
external usenet poster
 
Posts: 6
Default ok in 2000 not in 97

Thanks Tom, that explains alot. I am finding that these
version issues come up alot. Can I have both 2000 and 97
on the same computer?

Thanks for all you great help!
-----Original Message-----
I have found that deleting something in the rowsource in

Excel 97 causes a
crash.

I would try

set rng = Range(lbPending.RowSource)
lbPending.RowSource = ""
Sheet2.Range("a" & Rowcnt).EntireRow.Delete
lbPending.RowSource = rng.resize( _
rng.rows.count-1).address(external:=True)

--
Regards
Tom Ogilvy

cg wrote in message
...
I have a user form with a list box. It has 3 columns

and
has a named range as its rowsource. When the user

double
clicks an item in the listbox, it deletes the row and
bring up a user form with the information populated.

The
user can then save the info back to the sheet. It will

be
place in the next empty row. This works fine in 2000

but
when I took it to work where I have 97 it does not.
The 'update' info is not refelected back in the

listbox?
I also started getting a message that excel has

generated
error and will close. (not sure if that is related)

Belwo
is the code I have. If anyone has any ideas where I am
going wrong, I would be most greatful.

Private Sub lbPending_DblClick(ByVal Cancel As
MSForms.ReturnBoolean)

ufEntry.Hide

'when an item is double clicked in the 'pending
transactions' listbox
'bring up the create userform and populate with the
entries made so far

Dim Rowcnt As Long
Dim r As Long

Rowcnt = 0
RemoveDuplicates

For r = 0 To lbPending.ListCount - 1
If lbPending.Selected(r) Then

Rowcnt = r + 2 'listcount begins with 0 and row 1

is
headings so we add 2
'to match the row # with the

listindex
#
Dim how As String
how = Sheet2.Range("a" & Rowcnt).Value
Select Case how
Case "ebuy"
ufCreate.obebuy.Value = True
Case "PS7381"
ufCreate.ob7381.Value = True
Case "NA"
ufCreate.obNA.Value = True
End Select

Sheet2.Columns("B:B").EntireColumn.Hidden = False
ufCreate.tbApprovalDate.Value = Sheet2.Range("b" &
Rowcnt).Text
Sheet1.Columns("B:B").EntireColumn.Hidden = True


ufCreate.tbOrderDate.Value = Sheet2.Range("c" &
Rowcnt).Text
ufCreate.tbDescription.Value = Sheet2.Range("d" &
Rowcnt).Text
ufCreate.cbCatagory.Value = Sheet2.Range("e" &
Rowcnt).Text
ufCreate.cbVendor.Value = Sheet2.Range("f" &
Rowcnt).Text
ufCreate.tbInvoiceNum.Value = Sheet2.Range("g" &
Rowcnt).Text
ufCreate.tbReceiveDate.Value = Sheet2.Range("h" &
Rowcnt).Text
ufCreate.tbPaidDate.Value = Sheet2.Range("i" &
Rowcnt).Text
ufCreate.cbMethod.Value = Sheet2.Range("j" &
Rowcnt).Text
ufCreate.tbCost.Value = Sheet2.Range("k" &
Rowcnt).Text

'Now remove the transaction form the pending list
Sheet2.Range("a" & Rowcnt).EntireRow.Delete

End If
Next r

ActiveWorkbook.Names.Add Name:="lbPendingList",
RefersToR1C1:= _
"=PendingLog!R2C3:R40C5"

ufCreate.Show

End Sub



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default ok in 2000 not in 97

yes. Install from oldest to newest. During the install, choose not to
replace the existing version - install to a different location.

--
Regards,
Tmo Ogilvy

cg wrote in message
...
Thanks Tom, that explains alot. I am finding that these
version issues come up alot. Can I have both 2000 and 97
on the same computer?

Thanks for all you great help!
-----Original Message-----
I have found that deleting something in the rowsource in

Excel 97 causes a
crash.

I would try

set rng = Range(lbPending.RowSource)
lbPending.RowSource = ""
Sheet2.Range("a" & Rowcnt).EntireRow.Delete
lbPending.RowSource = rng.resize( _
rng.rows.count-1).address(external:=True)

--
Regards
Tom Ogilvy

cg wrote in message
...
I have a user form with a list box. It has 3 columns

and
has a named range as its rowsource. When the user

double
clicks an item in the listbox, it deletes the row and
bring up a user form with the information populated.

The
user can then save the info back to the sheet. It will

be
place in the next empty row. This works fine in 2000

but
when I took it to work where I have 97 it does not.
The 'update' info is not refelected back in the

listbox?
I also started getting a message that excel has

generated
error and will close. (not sure if that is related)

Belwo
is the code I have. If anyone has any ideas where I am
going wrong, I would be most greatful.

Private Sub lbPending_DblClick(ByVal Cancel As
MSForms.ReturnBoolean)

ufEntry.Hide

'when an item is double clicked in the 'pending
transactions' listbox
'bring up the create userform and populate with the
entries made so far

Dim Rowcnt As Long
Dim r As Long

Rowcnt = 0
RemoveDuplicates

For r = 0 To lbPending.ListCount - 1
If lbPending.Selected(r) Then

Rowcnt = r + 2 'listcount begins with 0 and row 1

is
headings so we add 2
'to match the row # with the

listindex
#
Dim how As String
how = Sheet2.Range("a" & Rowcnt).Value
Select Case how
Case "ebuy"
ufCreate.obebuy.Value = True
Case "PS7381"
ufCreate.ob7381.Value = True
Case "NA"
ufCreate.obNA.Value = True
End Select

Sheet2.Columns("B:B").EntireColumn.Hidden = False
ufCreate.tbApprovalDate.Value = Sheet2.Range("b" &
Rowcnt).Text
Sheet1.Columns("B:B").EntireColumn.Hidden = True


ufCreate.tbOrderDate.Value = Sheet2.Range("c" &
Rowcnt).Text
ufCreate.tbDescription.Value = Sheet2.Range("d" &
Rowcnt).Text
ufCreate.cbCatagory.Value = Sheet2.Range("e" &
Rowcnt).Text
ufCreate.cbVendor.Value = Sheet2.Range("f" &
Rowcnt).Text
ufCreate.tbInvoiceNum.Value = Sheet2.Range("g" &
Rowcnt).Text
ufCreate.tbReceiveDate.Value = Sheet2.Range("h" &
Rowcnt).Text
ufCreate.tbPaidDate.Value = Sheet2.Range("i" &
Rowcnt).Text
ufCreate.cbMethod.Value = Sheet2.Range("j" &
Rowcnt).Text
ufCreate.tbCost.Value = Sheet2.Range("k" &
Rowcnt).Text

'Now remove the transaction form the pending list
Sheet2.Range("a" & Rowcnt).EntireRow.Delete

End If
Next r

ActiveWorkbook.Names.Add Name:="lbPendingList",
RefersToR1C1:= _
"=PendingLog!R2C3:R40C5"

ufCreate.Show

End Sub



.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open 2000 file attachments in Excel 2000 Judy[_2_] Excel Discussion (Misc queries) 2 September 20th 07 10:20 PM
I cannot edit cell format in Excel 2000 (Part of office 2000)! Brett Excel Discussion (Misc queries) 1 April 12th 06 05:58 PM
Using Excel 2000 as Data source for Word 2000 document Malcolm Agingwell Excel Discussion (Misc queries) 2 June 21st 05 09:28 AM
Hyperlink in Excel 2000 can't open bookmarked Word 2000 file DCheslock Excel Discussion (Misc queries) 1 May 5th 05 10:46 PM
Excel Programs developed in Office 2000 on Windows 2000 Trooper Excel Discussion (Misc queries) 4 March 12th 05 11:09 PM


All times are GMT +1. The time now is 06:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"