![]() |
#1
|
|||
|
|||
![]()
Hi all,
My code is set up to copy a range of data ("B27:B49"), find the corresponding "header"("B97") in row 99 ("B99 ![]() The user then will go back to create the next header. The problem is that it keeps copying the next set of data in the same column (C), even though the header does not (any longer) match the "rngDetailToSearch.Find(What...." It overwrites the existing data from the last input, and will not move to the next cell in row 99 that actually matches the new header, named in B97. I could use a second set of eyes to see what I am doing wrong. Thank you HTML Code:
Sub PlaceInput() 'ActiveSheet.Unprotect Dim myDetailFind As Integer Dim rngDetail As Range Dim rngDetailToSearch As Range Dim rngDetailFound As Range Set wks = ActiveSheet Set rngDetailToSearch = ActiveSheet.Range("B99:DU99") Set rngDetailFound = rngDetailToSearch.Find(What:=wks.Range("B97"), _ LookIn:=xlValues, LookAt:=xlPart, MatchCase:=False) If Not rngDetailFound Is Nothing Then ActiveSheet.Range("B27:B49").Copy rngDetailFound.Offset(1, 0).PasteSpecial xlValues 'MsgBox myFind & " Input has been logged." Else End If Range("B10").ClearContents Range("B10").Select 'ActiveSheet.Protect End Sub Last edited by ufopilot; 02-19-2016 at 02:47 AM. |
![]() |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Hdata | Word VBA | 10 | 03-25-2019 07:57 AM |
![]() |
oswald | Excel | 1 | 02-08-2015 02:01 AM |
![]() |
MD011 | Excel Programming | 3 | 12-10-2014 02:15 AM |
![]() |
CClio333 | Word Tables | 1 | 08-12-2014 05:17 PM |
How to count cells containing data and meet certain criteria | AdamNT | Excel | 1 | 08-11-2006 11:51 PM |