?
Solved

VBA Submit button

Posted on 2016-10-16
9
Medium Priority
?
68 Views
Last Modified: 2016-11-15
Hello Experts,

Can I press submit button in sheet 1 and the VBA code will execute and data will get displayed in sheet 2

what should I do to have such a button?

Thanks
meetDinesh
0
Comment
Question by:Dinesh Kumar
  • 5
  • 2
8 Comments
 
LVL 33

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41846098
Please upload a sample workbook and show what data from sheet1 you would like to transfer to sheet2 by clicking the submit button.
0
 

Author Comment

by:Dinesh Kumar
ID: 41846104
there is a webservice call which gets the data, the call happens when I click on the submit button so that submit button is there is sheet1 and once I get the data from webservice I want to show the data in sheet2 instead of sheet1 so question here is that how can I do this in code, the data let us say can be employee information containing 10 columns. Please let me know if you need more inputs.
0
 
LVL 50

Expert Comment

by:Martin Liss
ID: 41846900
Can you provide a sample workbook as Neeraj requested?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Dinesh Kumar
ID: 41847024
Please find the sample where I want to show the results of 4th step in sheet2.

that 4th step I want to write in sheet1's VBA code
Book1.xlsx
0
 

Author Comment

by:Dinesh Kumar
ID: 41847031
Sub Submit_Click()
'1. Write ID in the sheet1
'2. Click on the Submit button in Sheet1
'3. Get the data from the Webservice based on the Ids
'4. the data is rendered in the Sheet2 as the format shown in the sheet 2
End Sub

The 4th Step I want to achieve.
0
 

Author Comment

by:Dinesh Kumar
ID: 41847690
please note that whenever we have a button in sheet1 then I think that button coding in VBA can have access to only sheet1 cells so I want to access sheet2 cells to render the data from sheet1 vba code.

its just like accessing sheet2 cells from sheet1 code.
0
 
LVL 50

Accepted Solution

by:
Martin Liss earned 2000 total points (awarded by participants)
ID: 41848515
whenever we have a button in sheet1 then I think that button coding in VBA can have access to only sheet1 cells
That's not true. You can refer to any sheet's data by referring to the sheet name. For example if you have a button on sheet1 and you want to refer to a cell on sheet2 you would do something like this:
MsgBox Worksheets("Sheet2").Range("A1")

Open in new window

0
 

Author Comment

by:Dinesh Kumar
ID: 41862799
seems it will work, will check.. thank you
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question