• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Hello and please help!

MrsN

New Member
Good afternoon all, your forum has saved me many times before but this time im stuck!


I am trying to create a form within Excel 2010 that needs to have the ability for people to add more sections...I have tries to write and record a macro to copy and paste the data below...but I can only get this to work once.


I need the macro to search for the free space under the workbook and paste it there, the macro I have been using will only work the first time as it pastes below the selected area.


Ideally I want to add a button to enable the user to press as many times as they need too, to add a box for each of their employees.


Help!!
 
MrsN


Firstly, Welcome to the Chandoo.org forums.


Without specific details it is hard to give anything specific


Here is some VBA code that does most of what you want

Add a Button to your worksheet and link it to the CopyData module


Copy the following code into a New Code Module in VBA

[pre]
Code:
Sub CopyData()

Dim SrcSheet As String
Dim DestSheet As String

SrcSheet = "Sheet1" 'Change to suit
DestSheet = "Sheet2"  'Change to suit

Sheets(SrcSheet).Range("A2:E5").Select 'Change to suit
Selection.Copy

Sheets(DestSheet).Activate
Range("A1").Select
Selection.End(xlDown).Offset(1, 0).Select
ActiveSheet.Paste

Application.CutCopyMode = False

Sheets(SrcSheet).Activate

End Sub
[/pre]
 
Hi Hui,


Thanks for the speedy reply!


The sheet I am working in has information on A1:Q51 that does not need to be copied and sits at the top of the sheet (in this case this is for the employers details and some geneiric info about the form).


Then from B56:M102 is the information that I need to have a button that can be pressed to duplicate this data either below on the next free line (as may be 'pressed' upto 10 times for 10 employees details) OR I could have the first employees details on the second sheet from A1:M50 and a button on the each seet to add another employee which would then copy this data onto the next form.


Sorry so confused!!


Many Thanks
 
MrsN


Can you upload a sample file with some data

Refer: http://chandoo.org/forums/topic/posting-a-sample-workbook
 
Hui,


Please see the link below to the file:


https://www.box.com/s/7828d804e38984999f87


See if it makes any more sense now!


Many Thanks for your support
 
Back
Top