PC Review


Reply
 
 
=?Utf-8?B?WmFhaGly?=
Guest
Posts: n/a
 
      18th Oct 2006
Hi
here's the scenario.......
Default number = 06/0241 ....
i have a userform (US1) with a button (CMD1), upon executing CMD1 ColumnA
cellA1 in the worksheet must be selected and a number inserted i.e. 06/0241 +
1. thiss cell should now display 06/0242, upon 2nd execution of CMD cellA2
should display 06/0243 etc...
is this posible to be done usin code....
Please assist

 
Reply With Quote
 
 
 
 
WhytheQ
Guest
Posts: n/a
 
      18th Oct 2006
something like the below might work:

'=====================================
Private Sub CMD1_Click()

Dim myRow As Integer
myRow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row

If Range("A1") = "" Then
Range("A1") = "06/0242"
Else
Cells(myRow + 1, 1) = "06/024" & myRow + 2
End If

End Sub
=====================================

Rgds
J


On Oct 18, 1:46 pm, Zaahir <Zaa...@discussions.microsoft.com> wrote:
> Hi
> here's the scenario.......
> Default number = 06/0241 ....
> i have a userform (US1) with a button (CMD1), upon executing CMD1 ColumnA
> cellA1 in the worksheet must be selected and a number inserted i.e. 06/0241 +
> 1. thiss cell should now display 06/0242, upon 2nd execution of CMD cellA2
> should display 06/0243 etc...
> is this posible to be done usin code....
> Please assist


 
Reply With Quote
 
=?Utf-8?B?U3RlZmk=?=
Guest
Posts: n/a
 
      18th Oct 2006
Function incr2nd(celltoinc As Range)
parts = Split(celltoinc, "/")
incr2nd = parts(0) & "/" & Format(parts(1) + 1, "0000")
End Function

Sub test()
x = incr2nd(ActiveCell)
End Sub

Regards,
Stefi

„Zaahir” ezt *rta:

> Hi
> here's the scenario.......
> Default number = 06/0241 ....
> i have a userform (US1) with a button (CMD1), upon executing CMD1 ColumnA
> cellA1 in the worksheet must be selected and a number inserted i.e. 06/0241 +
> 1. thiss cell should now display 06/0242, upon 2nd execution of CMD cellA2
> should display 06/0243 etc...
> is this posible to be done usin code....
> Please assist
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help please, Having trouble finding/adding users for purpose of granting permissions or adding them to groups in a win 2k domain on an XP workstation. rmalph@happy.days Microsoft Windows 2000 Security 4 16th Oct 2004 07:11 AM
Need help please, Having trouble finding/adding users for purpose of granting permissions or adding them to groups in a win 2k domain on an XP workstation. rmalph@happy.days Microsoft Windows 2000 New Users 1 12th Oct 2004 07:13 PM
Need help please, Having trouble finding/adding users for purpose of granting permissions or adding them to groups in a win 2k domain on an XP workstation. rmalph@happy.days Microsoft Windows 2000 Deployment 0 11th Oct 2004 11:39 PM
Need help please, Having trouble finding/adding users for purpose of granting permissions or adding them to groups in a win 2k domain on an XP workstation. rmalph@happy.days Microsoft Windows 2000 0 11th Oct 2004 11:37 PM
Need help please, Having trouble finding/adding users for purpose of granting permissions or adding them to groups in a win 2k domain on an XP workstation. rmalph@happy.days Microsoft Windows 2000 Deployment 0 11th Oct 2004 11:35 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:10 AM.