+ Reply to Thread
Results 1 to 7 of 7

Pinpoint a moving cell

Hybrid View

  1. #1
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Pinpoint a moving cell

    Select the range to copy and Run.
    Sub ppCopy()
      Dim p1 As Range, p2 As Range
      Dim r As Long, c1 As Range, c2 As Range
      Dim c As Range, s As String
      
      Set p1 = Selection
      Set p2 = Application.InputBox("Select TopLeft cell to pasted selection to.", _
        "Select Cell", Type:=8)
      Set p2 = p2.Resize(p1.Rows.Count, p1.Columns.Count)
      p1.Copy p2
      
      Set c1 = p1(1, 2) 'The old Name cell.
      Set c2 = p2(1, 2) 'The new Name cell.
      For r = 3 To p2.Rows.Count
        Set c = p2(r, 1)
        s = c.Formula
        c.Formula = Replace(s, c1.Address, c2.Address)
      Next r
      
      c2.Select 'Ready to change Name
    End Sub

  2. #2
    Forum Contributor
    Join Date
    04-04-2016
    Location
    dallas tx
    MS-Off Ver
    365 (15.0.5501.1000)
    Posts
    541

    Re: Pinpoint a moving cell

    I must admit, I don't really understand this. What do I change to make it work for me?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Pinpoint a specific cell according to other condition
    By chosford in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-30-2013, 08:33 AM
  2. What is the best way to pinpoint a certain cell that has different locations?
    By kjy1989 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-27-2013, 06:17 PM
  3. Auto-Converting Cell Value to link & moving rows of data based on cell value
    By Th3Forgotten in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-15-2013, 08:05 AM
  4. [SOLVED] How to pinpoint specific date from limiting ranges
    By narbit in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 08-16-2012, 04:01 PM
  5. Replies: 0
    Last Post: 05-21-2012, 06:59 AM
  6. Copying moving range based on moving cell reff.
    By Varmark in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-19-2011, 04:47 AM
  7. Replies: 4
    Last Post: 03-28-2005, 05:06 PM
  8. Replies: 7
    Last Post: 03-27-2005, 08:06 PM

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