Macro return in the active worksheet

DSNTNOENUF

New Member
Joined
Aug 3, 2015
Messages
32
Good Day!

I am running a macro that copies, parses, and selects, data from an input page. I have buttons assigned to the macro on each worksheet page I need the information pasted too. (so around 30 total worksheets, 1 for each day.) The problem I am running into is that it continually references the first page or original that I had recorded the macro on and I don't know how to tell it to paste into the active page. Is there someone out there far better than me who could send me a return value to active worksheet and specifically to past in column H start row 1?

Thank you so much as always. This is an incredible community!
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Can you post the current code?
 
Upvote 0
Good Day!

I am running a macro that copies, parses, and selects, data from an input page. I have buttons assigned to the macro on each worksheet page I need the information pasted too. (so around 30 total worksheets, 1 for each day.) The problem I am running into is that it continually references the first page or original that I had recorded the macro on and I don't know how to tell it to paste into the active page. Is there someone out there far better than me who could send me a return value to active worksheet and specifically to past in column H start row 1?

Thank you so much as always. This is an incredible community!


Sub txt_2_column()
'
' txt_2_column Macro
'

'
'selection copy'
ActiveWindow.ScrollWorkbookTabs Sheets:=-1
ActiveWindow.ScrollWorkbookTabs Sheets:=-1
ActiveWindow.ScrollWorkbookTabs Sheets:=-1
ActiveWindow.ScrollWorkbookTabs Sheets:=-1
ActiveWindow.ScrollWorkbookTabs Sheets:=-1
ActiveWindow.ScrollWorkbookTabs Sheets:=-1
ActiveWindow.ScrollWorkbookTabs Sheets:=-1
Sheets("INPUT").Select
Range("A1:A4000").Select
Selection.Find(What:="TOTAL OF PAYMEN", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
Selection.ColumnWidth = 24.86
Selection.ColumnWidth = 39.57
Range("A1:A4000").Select
Selection.Copy
ActiveWindow.ScrollWorkbookTabs Sheets:=1
ActiveWindow.ScrollWorkbookTabs Sheets:=1
ActiveWindow.ScrollWorkbookTabs Sheets:=3
Columns("A:A").ColumnWidth = 4.71
ActiveWindow.ScrollWorkbookTabs Sheets:=1
ActiveWindow.ScrollWorkbookTabs Sheets:=1

'results need to be pasted to the active worksheet'
'missing selection here'

Range("H1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False



End Sub

looking for something like selection_activeworksheet_("H1")_paste
 
Upvote 0
Not 100% clear exactly what you want to copy but this will copy A1:A4000 from the sheet 'INPUT' to the active sheet.
Code:
Sub txt_2_column()
    Sheets("INPUT").Range("A1:A4000").Copy
    ActiveSheet.Range("H1").PasteSpecial Paste:=xlPasteValues
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,990
Messages
6,122,625
Members
449,093
Latest member
catterz66

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top