Hi All,

I have macro which I'm applying on files but every time I have to make two
changes in macro, is it possible that the popup appear and ask for that two
values and store in b2 and c2?

Thanks in advance

RE: Popup in excel macro by OssieMac

OssieMac
Thu Jul 24 01:14:01 CDT 2008

The following is an example of getting user input. Lookup Inputbox in help
for more info on the the subject.

Sub InputData()

Dim data4B2 As Variant
Dim data4C2 As Variant

data4B2 = InputBox("Enter data for cell B2")
Sheets("Sheet1").Range("B2") = data4B2

data4C2 = InputBox("Enter data for cell C2")
Sheets("Sheet1").Range("C2") = data4C2

End Sub

--
Regards,

OssieMac


"Hassan" wrote:

> Hi All,
>
> I have macro which I'm applying on files but every time I have to make two
> changes in macro, is it possible that the popup appear and ask for that two
> values and store in b2 and c2?
>
> Thanks in advance

RE: Popup in excel macro by Hassan

Hassan
Thu Jul 24 08:18:01 CDT 2008

Thanks for reply.
There is one more query that when I am apply following then I have to change
sheet name to Sheet1, is it possible to run on opened sheet, If yes then
where I have to make changes?

Thanks

Hassan

"OssieMac" wrote:

> The following is an example of getting user input. Lookup Inputbox in help
> for more info on the the subject.
>
> Sub InputData()
>
> Dim data4B2 As Variant
> Dim data4C2 As Variant
>
> data4B2 = InputBox("Enter data for cell B2")
> Sheets("Sheet1").Range("B2") = data4B2
>
> data4C2 = InputBox("Enter data for cell C2")
> Sheets("Sheet1").Range("C2") = data4C2
>
> End Sub
>
> --
> Regards,
>
> OssieMac
>
>
> "Hassan" wrote:
>
> > Hi All,
> >
> > I have macro which I'm applying on files but every time I have to make two
> > changes in macro, is it possible that the popup appear and ask for that two
> > values and store in b2 and c2?
> >
> > Thanks in advance

Re: Popup in excel macro by Gord

Gord
Thu Jul 24 10:59:46 CDT 2008

Change Sheets("Sheet1").Range("B2") = data4B2

To ActiveSheet.Range("B2") = data4B2

In both instances


Gord Dibben MS Excel MVP

On Thu, 24 Jul 2008 06:18:01 -0700, Hassan
<Hassan@discussions.microsoft.com> wrote:

>Thanks for reply.
>There is one more query that when I am apply following then I have to change
>sheet name to Sheet1, is it possible to run on opened sheet, If yes then
>where I have to make changes?
>
>Thanks
>
>Hassan
>
>"OssieMac" wrote:
>
>> The following is an example of getting user input. Lookup Inputbox in help
>> for more info on the the subject.
>>
>> Sub InputData()
>>
>> Dim data4B2 As Variant
>> Dim data4C2 As Variant
>>
>> data4B2 = InputBox("Enter data for cell B2")
>> Sheets("Sheet1").Range("B2") = data4B2
>>
>> data4C2 = InputBox("Enter data for cell C2")
>> Sheets("Sheet1").Range("C2") = data4C2
>>
>> End Sub
>>
>> --
>> Regards,
>>
>> OssieMac
>>
>>
>> "Hassan" wrote:
>>
>> > Hi All,
>> >
>> > I have macro which I'm applying on files but every time I have to make two
>> > changes in macro, is it possible that the popup appear and ask for that two
>> > values and store in b2 and c2?
>> >
>> > Thanks in advance