View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Macro with input box to Select a column on active sheet

Here is some untested pseudo code:

Dim r as Range, r1 as Range
Dim r2 as Range, cell as Range
Dim res as Variant
On error resume Next
set r = Nothing
set r = Application.InputBox( _
"Select destination column in Summary",type:=8)
On Error goto 0
if r is nothing then exit sub

with worksheets("Daily")
set r1 = .Range(.Cells(2,1),.Cells(2,1).end(xldown))
end with
with worksheets("Summary")
set r2 = .Range(.Cells(2,1),.Cells(2,1).End(xldown))
End with
for each cell in r1
res = Application.Match(cell,r2,0)
if not iserror(res) then
set r3 = r2(res)
cell.offset(0,1).Resize(1,3).copy
r3.offset(1,r.column-1).Pastespecial Transpose:=True
end if
Next

--
Regards,
Tom Ogilvy



"Marcusdmc" wrote:

The input box would be to determine which date(column) you wanted to
paste into for each person on the monthly sheet