+ Reply to Thread
Results 1 to 5 of 5

A really useful macro required

  1. #1
    Registered User
    Join Date
    01-27-2005
    Posts
    2

    A really useful macro required

    Can anyone out there help me? I am trying to build a macro that will save me tons of time but is it possible?

    I need a macro that will allow me to copy the contents of a cell and paste it into another cell just by clicking on the first cell and then selecting and clicking on the cell onto which the data is to be pasted. In other words, I could go through large amounts of data simply clicking once to copy and once to paste.

    It sounds too good to be possible. Can anyone help please?

    Regards

    Carl

  2. #2
    Forum Contributor
    Join Date
    01-18-2005
    Location
    Auckland New Zealand
    MS-Off Ver
    Office Professional 2007
    Posts
    295
    Can you describe the kind of actions you have to take at the moment, and the format of your data, a bit more fully?

    Regards

  3. #3
    Registered User
    Join Date
    08-13-2004
    Posts
    46
    I was fiddling around and came up with this....

    I guess it could be a start

    Private Sub Worksheet_selectionChange(ByVal Target As Range)
    With Target
    If Target <> "" Then
    .Select
    Selection.Copy

    End If

    If Target = "" Then
    .Select
    Selection.PasteSpecial
    End If
    End With
    End Sub

    All you do is click on the cell you want to copy. then click on the new cell.

    The weird part is if you are actually trying to enter data it will execute the macro.

    If anything it is a start. I will post more if I figure it out
    Last edited by eluehmann; 01-27-2005 at 10:25 AM.

  4. #4
    Registered User
    Join Date
    01-27-2005
    Posts
    2
    Thank you for your replies. Mikeopolo - I will describe the actions I wish to automate using a macro: 1. Click on cell G1 (G1 contains a the name J SMITH)
    2. Copy cell G1
    3. Click on cell A1 (destination cell)
    4. Paste name to cell A1
    5. Click on cell G2 (G2 contains the name M JONES)
    6. Repeat steps 2 to 4 loads and loads of times.

    What I am doing is allocating carers to clients where the columns contain lists of clients and carers and the rows contain the times of the visits.

    Regards

    Carl

  5. #5
    Registered User
    Join Date
    01-28-2005
    Posts
    70
    This may be a dumb question, but why don't you simply select the first cell to be copied (G1), hold down the shift key and click on the last cell to be copied (G1+n), CTRL-C, then click on A1 and CTRL-V. This will copy the whole section over.

    And if you're trying to copy the whole column, you can just click on the column head (G), copy, select A column and hit paste.

    If that's not it, then I'm not understanding why you have to copy each one individually.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1