Solved

VBA Submit button

Posted on 2016-10-16
9
35 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 28

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 45

Expert Comment

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

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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

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 45

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now