Auto Fill Macro with Input Box

Parra

Well-known Member
Joined
Feb 21, 2002
Messages
752
I have the macro below that looks at the sheet name in column A and copies what is in Column B to the sheet that is column A.

Ex
Col A Col B
Sheet1 5000

So in Sheet 1 it adds 5000

The problem is I want the cell I want the data to go to change. This means when I want it to go somewhere else I have to go into the macro and change the target cell.

Can someone please help me create an input box where the box would appear and I would just enter the the column and row and the macro would then run.

Here is the target cell for this week
.Cells(21, 15)

Thanks

Sub Macro1()


myRow = 1

Do Until Cells(myRow, 1) = ""
myName = Cells(myRow, 1)
Sheets("" & myName).Cells(21, 15) = Cells(myRow, 2)
myRow = myRow + 1
Loop

'
End Sub
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Forum statistics

Threads
1,214,837
Messages
6,121,883
Members
449,057
Latest member
Moo4247

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