Creating a new sheet and inputting data to it when conditions are met

owlinfestation

New Member
Joined
Mar 2, 2016
Messages
3
Hello! I am starting with a basic sheet of data and way-too-complicated of a procedure to know where to start...

There will be data existing in columns A and B. When data is first entered into a column C, I need a new sheet created with a mix of standard text and the data from the rest of the row (columns A and B) that the data was entered in. Every new instance of data being entered into column C needs to generate a new sheet fitting these conditions.

I can provide more particulars on request, but at this point, I'm wondering how intensive of a process it would be to code this, and if it is worth the time it will same. My alternative is copying and pasting onto a new sheet each instance of data on a data set that could reach a couple hundred rows in length.

Thanks for your thoughts!
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Welcome to the Forum!

Yes, more detail would be helpful. I'm guessing that you mean:

- Enter X in column C --> create a new X sheet and copy X data across
- Enter Y in column C --> create a new Y sheet and copy Y data across
- Enter X in column C again --> Add X data to X sheet already existing
- etc etc

How: Yes, this should be relatively simple to code in VBA

Why: ???? What are you achieving by spreading your data across multiple sheets in this way?
 
Upvote 0
Thanks for the welcome and response!

The spreadsheet is three columns. In order: REGistration code, PIN, and an as-yet empty column for NAME. When I enter a NAME, I would like a new sheet generated that says:
NAME, here is your access information for www.website.com
Registration code: REG
Personal Identification Number: PIN

If I enter 40 names, I would like 40 new sheets to be created so that I can print them in a batch (orrr if there's a script to have one sheet print all the new name additions that would be awesome, but probably borderline wizardry).

At this point, I'm thinking it will be more work than it's worth, and that's alright! I can just do a bunch of copy/paste.
 
Upvote 0
Here's some simple code (and workbook: https://app.box.com/s/6s1uc4sokj3uadmjxuqy4npbt1d1ih4t) to illustrate what can be done with automation.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)

    Dim rngToCheck As Range, rngCell As Range
    
    Set rngToCheck = Intersect(Target, Range("C2:C" & Range("A2").End(xlDown).Row))
    
    If Not rngToCheck Is Nothing Then
        For Each rngCell In rngToCheck
            Range("A" & rngCell.Row).Resize(, 3).Copy Worksheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1)
        Next rngCell
    End If
    
End Sub

Excel 2010
ABCDE
1CodePinName
2AAAAAA3972BillExisting
3BBBBBB9549Mary
4CCCCCC4069NewName1New
5DDDDDD4675NewName2
6EEEEEE2567
7FFFFFF8833
8HHHHHH4053
9IIIIII3725
10JJJJJJ8860

<tbody>
</tbody>
Sheet1
---> automatically generates:

Excel 2010
ABC
1New Names added this session
2CCCCCC4069NewName1
3DDDDDD4675NewName2

<tbody>
</tbody>
Sheet2

It's not robust code. Just a concept to perhaps make you think about possibilities.

It would be relatively simple to write code to print in bulk, individually, generate individual PDFs, individual e-mails etc etc.
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

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