Selecting cells within a named column

JMK326

New Member
Joined
Sep 16, 2013
Messages
15
Every time this macro is being used, the data comes from a different column but always on the same rows. I set FY13column to the user selected column but I can't figure out how to copy specific cells from within that column.

Here is what I have that is not working:
Set FY13column = Application.InputBox(prompt:="Select the column that contains the FY13 current month data", Type:=8)
Sheets("Current Month Data").Range("E5").Copy Sheets("Month to Month").Cells(FY13column, 36)
 
Try this instead:

Code:
FY13column = Application.InputBox(prompt:="Select", Type:=1)
Sheets("Month to Month").Cells(36, FY13column).Value = Sheets("Current Month Data").Range("E5").Value

The prompt type is now 1 so it is expecting a number not a cell reference like "Sheet1!A1".
The rows and columns in Cells has been swapped round.
I changed, possible unnecessarily, the COPY command to a straight assignment
 
Upvote 0

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