PDA

View Full Version : Input box and sheet



jeelpuranik
02-04-2021, 02:10 PM
Hello everyone,
I am working on an excel vba project and i need help with something

right now i have two inputbox and its value is stored in variable FirstAnchor and LastAnchor
and i have another sheet which has few numbers stored in a row

now if user enters 3 in firstanchor and 10 in second anchor i just want to add the values that are present in A3 to A10 from that another sheet

mancubus
02-05-2021, 12:23 AM
hi,

pls elaborate your requirement; post your code, or even better, your workbook.

jeelpuranik
02-05-2021, 08:09 AM
This is my code where i described first anchor point and last anchor point and this code is for sheet("manualInput")
Dim VarFirstAnchor As Integer
VarFirstAnchor = Application.InputBox("Please enter initial Anchor Point", "Initial Anchor Point ", 1)
Range("A21").Value = "First Anchor Point"
Range("B21").Value = Int(VarFirstAnchor)

And TemporarySheet is another sheet where a series of number entered by user is stored in Column A

like say user entered 20 different number and he entered 5 in first anchor point and 10 in second anchor point so i want to add numbers from 5 to 10 that user entered.


Dim VarLastAnchor As Integer
VarLastAnchor = Application.InputBox("Please enter Last Anchor Point", "Last Anchor Point ", 1)
Range("A23").Value = "Last Anchor Point"
Range("B23").Value = Int(VarLastAnchor)

p45cal
02-08-2021, 06:46 AM
try:
Sheets("Temporary Sheet").Range("A" & VarFirstAnchor & ":A" & VarLastAnchor).Copy Range("A25")