Solved

VBA Submit button

Posted on 2016-10-16
9
40 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
9 Comments
 
LVL 30

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 47

Expert Comment

by:Martin Liss
ID: 41846900
Can you provide a sample workbook as Neeraj requested?
0
Technology Partners: 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 47

Accepted Solution

by:
Martin Liss earned 500 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

Independent Software Vendors: 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!

Question has a verified solution.

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

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

685 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