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

Trying to make it so that instead of naming the worksheet "summary",
they can just be on the worksheet they want to modify with the
information from the "daily" page. trying this but it's not working,
getting a type mismatch on the with works

Sub TestMe()
Dim mSheet As Worksheet
Set mSheet = ActiveSheet

Dim sr As Range, sr1 As Range
Dim sr2 As Range, cell As Range
Dim res As Variant
On Error Resume Next
Set sr = Nothing
Set sr = Application.InputBox( _
"Select Weekly Column to update", Type:=8)
On Error GoTo 0
If sr Is Nothing Then Exit Sub


With Worksheets(mSheet)
Set sr1 = .Range(.Cells(2, 1), .Cells(2, 1).End(xlDown))
End With
With Worksheets(mSheet)
Set sr2 = .Range(.Cells(2, 1), .Cells(2, 1).End(xlDown))
End With
For Each cell In sr1
res = Application.Match(cell, r2, 0)
If Not IsError(res) Then
Set sr3 = sr2(res)
cell.Offset(0, 1).Resize(1, 3).Copy
r3.Offset(1, r.Column - 1).PasteSpecial Transpose:=True
End If
Next

End Sub


-Marcus