+ Reply to Thread
Results 1 to 5 of 5

Micro working in multiple cells

  1. #1
    Registered User
    Join Date
    06-07-2008
    Posts
    14

    Question Micro working in multiple cells

    I needed a micro to use one cell to enter dates and move it over to the right everytime I entered a new date. I have a micro that does that for me but what I need it to do is to be able to go to any cell in column A from 1 to 10
    enter date in A1 or A10 and have the date move over: example if A1 the date moves to B1 and so on. In A10 enter date and move to B10 and so on. This micro only lets me pick one cell. I want to be able to do it from multiple cells.


    Private Sub Worksheet_Change(ByVal Target As Range)

    If Target.Address = "$A$2" Then
    If Not IsEmpty(Target) Then
    Application.EnableEvents = False
    Target.Insert Shift:=xlShiftToRight, CopyOrigin:=Target
    Application.EnableEvents = True
    End If
    End If

    End Sub

  2. #2
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628
    Try with this code:
    Please Login or Register  to view this content.
    Regards,
    Antonio

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Jalicea,

    Please read the Forum Rules and then wrap your code with Code Tags.

  4. #4
    Registered User
    Join Date
    06-07-2008
    Posts
    14
    Sorry,
    Thanks

  5. #5
    Registered User
    Join Date
    06-07-2008
    Posts
    14

    Question It works but with problems

    What I done is, I CHANGE THE STARTING COLUMN AND CELL, BUT IT STILL WOKED. The problem comes if a mistake happens the micro stops working . Also I added a =CountA and it stops counting after I enter in eorror a date.If I ente a date it moves over but the mico stops working a count. I tryed $ signs but it does not hold it. What mus I do?

+ 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