PDA

View Full Version : Solved: make certain cells visible



pinky
05-31-2010, 09:57 PM
Hi all,
I am new to VBA and am working on stores inventory management project.
I have 2 columns, "cartridge code" and "stock present", as it is a long list, i have to display only first 10 of them and to scroll for others. And when a cell is updated it should be visible in first row followed by others. I need a code or macro for this. Please help!!:(

Thanks in advance

mdmackillop
06-01-2010, 09:45 AM
Try this

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 3 And Target.Row > 2 And Target.Cells.Count = 1 Then
Application.EnableEvents = False
Target.EntireRow.Cut
Cells(2, 1).Insert
Application.EnableEvents = True
End If
End Sub

pinky
06-01-2010, 10:56 PM
Thanks a bunch mdmackillop,
it worked great:)
I have two columns
Cartridge Part Num Available stock
C6OOX4 20
CG5643 177
CKX647 10
CLU73 26
CX142 79
CV765 12

And it goes on, there are around 150 cartridges. My problem is that I have to display only first 10 among those and insert a vertical scroll bar, so that user scrolls down to see the remaining. I tried many codes but of no use.I am out of time Please help.... :(

pinky
06-01-2010, 11:11 PM
Thanks a million mdmackillop...
I freezed the planes and Everything worked simply great:thumb