Hi all, I have a need for a macro that does the following:
Predefined Range “Contents” = B7 – X66
1. Search Column C of “Contents” for the first empty cell (from the top)
2. Copy a Row (Column B to Column X) from a set location (C100 – X100).
3. Paste in the empty row
4. Select the newly pasted row
5. Replace “1” with “B[EmptyRow] – there is a number in B regardless of whether C is empty.
Thanks!
I have posted below what I have - this pastes the new row into a static #39 - the trouble I'm having is making this row # dynamic based on which row is empty. The number 39 is in Column B and represents a project number which points coresponds to a worksheet of the same name.
Quote:
Sub AddContents()
'
' AddContents Macro
'
'
Range("C100:X100").Select
Range("L100").Activate
Selection.Copy
Range("C45:X45").Select
ActiveSheet.Paste
Selection.Replace What:="'1'", Replacement:="'39'", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End Sub
|