Help with this macro

Minaru

New Member
Joined
Sep 20, 2010
Messages
25
Thanks in advance for the help.

I need to give a batch name to an amount, this name will not change between months it will always be the same set names for each batch but I can only give 1 name per amount shown per day in a month; that said this is how it works
Code:
date          $      Batch name

01/01     $10.00     7A
01/02     $20.00     7B
01/03     
01/04     $15.00     7C
01/05     
01/06     $40.00     7D
etc

So what I want is a macro that does the batch names automatically as I input the information on the $ cell. What I started doing was something along the lines of this.
Code:
MyArray = Array("7A", "7B", "7C", "7D", "7E", "7F", "7G", _
  "7H", "7I", "7J", "7K", "7L", "7M", "7N", "7O", "7P", "7Q", _
  "7R", "7S", "7T", "7U", "7V", "7W", "7X", "7Y", "7Z")
  
For I = 1 To Cells(Rows.Count, 2).End(xlUp).Row
    If Cells(I, 2).Value <> "" Then
        Cells(I, 1).Value = MyArray(I - 1)
    End If
Next I
But the problem is that I do not know how to make my array to choose the following batch name not the I value one.

Thanks
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,224,569
Messages
6,179,605
Members
452,928
Latest member
VinceG

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top