Jerry138889
New Member
- Joined
- May 23, 2013
- Messages
- 28
Hey.
I'm trying to make a new worksheet with data for every change in Customer name. So, for example, the below table would represent the raw data on sheet 1. I want the macro to create a new worksheet whenever the Customer Name changes i.e. (Customer Name) =/= (Customer Name -1).
I want sheet 2 to have XYZ's data only, sheet 3 to have TUNIJM's data only, sheet 4 to have SGFG etc.
<tbody>
</tbody>
I've been looking around the forum for a bit and have come up (possibly) with parts of the code I'm looking for. The macro could name the new worksheet after the Customer Name too, but that is not a priority.
I've tried to fiddle about with this and replace some text in the macro but I'm probably not substituting properly and I don't really understand what I'm doing!
I appreciate any help.
I'm trying to make a new worksheet with data for every change in Customer name. So, for example, the below table would represent the raw data on sheet 1. I want the macro to create a new worksheet whenever the Customer Name changes i.e. (Customer Name) =/= (Customer Name -1).
I want sheet 2 to have XYZ's data only, sheet 3 to have TUNIJM's data only, sheet 4 to have SGFG etc.
Customer Name | Currency | Account Type | Balance | |
XYZ Ltd | £ | Normal | 1000 | |
XYZ Ltd | $ | Normal | 1000 | |
XYZ Ltd | € | Priority | 1000 | |
XYZ Ltd | Y | Normal | 1000 | |
TUNIJM Ltd | £ | Normal | 1000 | |
TUNIJM Ltd | € | Priority | 1000 | |
SGFG Ltd | £ | Normal | 1000 | |
SGFG Ltd | $ | Normal | 1000 | |
SGFG Ltd | $ | Priority | 1000 | |
SGFG Ltd | £ | Priority | 1000 | |
SGFG Ltd | € | Normal | 1000 | |
UKBN Ltd | € | Normal | 1000 | |
UKBN Ltd | $ | Normal | 1000 | |
UKBN Ltd | € | Normal | 1000 |
<tbody>
</tbody>
I've been looking around the forum for a bit and have come up (possibly) with parts of the code I'm looking for. The macro could name the new worksheet after the Customer Name too, but that is not a priority.
I've tried to fiddle about with this and replace some text in the macro but I'm probably not substituting properly and I don't really understand what I'm doing!
Code:
If Range("A" & Rw) <> Range("A" & Rw - 1) Then
For cnt = 1 To sh
Sheets(sh).Insert
I appreciate any help.