Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i use the code below to find the last record in my workbook. some times it
work without problem some times it goes to the last record even if the first record is empty. can someone help me with this code. how can i simplify it? Private Sub MultiPage1_Change() If MultiPage1.Pages(3).Visible = True Then 'check for last item Workbooks("Declaration Pro.xls").Worksheets("Classification").Activate Range("B5").Select If ActiveCell.Value < "" Then Do If IsEmpty(ActiveCell) = False Then ActiveCell.Offset(1, 0).Select End If Loop Until IsEmpty(ActiveCell) = True ActiveCell.Offset(-1, 0).Select End If 'load controls with last item's value------------ cboTariffNo.Value = ActiveCell.Value txtDescription.Value = ActiveCell.Offset(0, 1).Value txtItemFob.Value = ActiveCell.Offset(0, 4).Value cboCPC.Value = ActiveCell.Offset(0, 18).Value txtSupplQuantity.Value = ActiveCell.Offset(0, 19).Value cboCountryOfOrigin.Value = ActiveCell.Offset(0, 20).Value txtNoPackage.Value = ActiveCell.Offset(0, 21).Value cboPackageType.Value = ActiveCell.Offset(0, 22).Value cboEnvSurChar.Value = ActiveCell.Offset(0, 25).Value txtNetWeight.Value = ActiveCell.Offset(0, 26).Value lblItemNo.Caption = ActiveCell.Offset(0, -1) End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
To find rate of each item from item.xls and to copy price.xls | Excel Discussion (Misc queries) | |||
Find Record Box | Excel Discussion (Misc queries) | |||
Find record | Excel Worksheet Functions | |||
Find Record | Excel Discussion (Misc queries) | |||
Find the Record | Excel Programming |