Solved

VBA Submit button

Posted on 2016-10-16
9
39 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 46

Expert Comment

by:Martin Liss
ID: 41846900
Can you provide a sample workbook as Neeraj requested?
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

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 46

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
Modern/Metro styled message box and input box that directly can replace MsgBox() and InputBox()in Microsoft Access 2013 and later. Also included is a preconfigured error box to be used in error handling.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

839 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