Solved

VBA Submit button

Posted on 2016-10-16
9
42 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
9 Comments
 
LVL 31

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
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 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
Use Windows Task Scheduler to print a Word document weekly so your printer ink won't dry out.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

734 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