Advisory macro

litrujilloh1

New Member
Joined
May 10, 2023
Messages
2
Office Version
  1. 2021
Platform
  1. Windows
Buen día. Agradezco consejos sobre lo siguiente:
Necesito un formulario de Excel que solicite un número del 1 al 100 y luego, en función de ese número, seleccione un rango asociado con ese número y péguelo en otro lugar. Ejemplo: Si el número seleccionado es 10, vaya a otra hoja y seleccione de A2 a D11, copie ese dato y péguelo en otra hoja. Gracias.
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
That is not too difficult to achieve. But how does the macro decide which range to copy and where to copy it to?
  • So if the user selects 1 which range is to be copied, and where does it need to be copied to?
  • if the user selects 2 which range is to be copied, and where does it need to be copied to?
What is the logic for the selection of these ranges?
 
Upvote 0
Thanks for write. Well, the idea is to make a macro that, according to what you type, copies the number of rows of a respective range in another sheet.

For example

message = "Enter the number of iterations"
title = "Financial Simulation"
a = InputBox(message, title)
b = Val(a)
Do While c < b

This capture if I type 2, go to a sheet, select 2 lines:
A1:D2 and paste it onto another sheet. But if I type 3 in the macro, it selects A1:D3 and pastes it on another sheet.
 
Upvote 0
Sorry that I did not reply to this yet. Do you still need help with it, oor has it been resolved?
 
Upvote 0

Forum statistics

Threads
1,214,806
Messages
6,121,672
Members
449,045
Latest member
Marcus05

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