#1   Report Post  
Mark
 
Posts: n/a
Default Macro

Hi

I am new to all this, so i will try and explain what I am
trying to achieve with this workbook.

I want to open a workbook with three worksheets, all
worksheets will have the following headings in A1(Batch
No), B1(Date Sent), C1(Amount) & D1(Date Paid).
In sheet 1 when you click the command button I would like
to generate a numeric number which would appear in A2,
then if I require a further number this time when I click
the command button the next number would appear in A2.
I have the following macro running which works fine for
the first part of this problem.
Public Sub RCA()
If IsEmpty(Range("A2").Value) Then
Range("A2").Value = InputBox("Enter Starting
Value")
Else
Range("A" & Rows.Count).End(xlUp).Offset(1,
0).Value = _
Application.Max(Range("A:A")) + 1
End If
End Sub

How can I adapt the above macro or use another in order
to achieve the following in sheet 2 & 3.

In sheet 2 I would like the same to happen except the
batch number in cell A2, A3, A4 etc needs to start with
the ref PCI followed by the first number for example
(PCI1, PCI2, PCI3 and so on).
I would like the same thing to happen in sheet 3 however
the ref in cell A2 A3, A4 etc need to start with the ref
PCICR followed by the first number for example (PCICR1,
PCICR2, PCICR3 and so on).
Hope you can understand this thanks for any help.


  #2   Report Post  
 
Posts: n/a
Default

i got this sorted thanks anyway
-----Original Message-----
Hi

I am new to all this, so i will try and explain what I

am
trying to achieve with this workbook.

I want to open a workbook with three worksheets, all
worksheets will have the following headings in A1(Batch
No), B1(Date Sent), C1(Amount) & D1(Date Paid).
In sheet 1 when you click the command button I would

like
to generate a numeric number which would appear in A2,
then if I require a further number this time when I

click
the command button the next number would appear in A2.
I have the following macro running which works fine for
the first part of this problem.
Public Sub RCA()
If IsEmpty(Range("A2").Value) Then
Range("A2").Value = InputBox("Enter Starting
Value")
Else
Range("A" & Rows.Count).End(xlUp).Offset(1,
0).Value = _
Application.Max(Range("A:A")) + 1
End If
End Sub

How can I adapt the above macro or use another in order
to achieve the following in sheet 2 & 3.

In sheet 2 I would like the same to happen except the
batch number in cell A2, A3, A4 etc needs to start with
the ref PCI followed by the first number for example
(PCI1, PCI2, PCI3 and so on).
I would like the same thing to happen in sheet 3 however
the ref in cell A2 A3, A4 etc need to start with the ref
PCICR followed by the first number for example (PCICR1,
PCICR2, PCICR3 and so on).
Hope you can understand this thanks for any help.


.

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
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM
automatic macro update boconnell Excel Worksheet Functions 4 February 9th 05 07:10 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 04:46 PM
Macro Formula revision? Mark Excel Worksheet Functions 1 November 28th 04 01:43 AM


All times are GMT +1. The time now is 11:28 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"