LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to update a subroutine in another excelsheet with a Macro

Private Sub CommandButton1_Click()
'Define an excel object
Dim objExcel As Object

'Open the excel sheet which needs to be changed
Set objExcel = CreateObject("Excel.Application")
objExcel.Workbooks.Open Filename:=Application.GetOpenFilename

'Replace text of a cell in the 'Risk, Issue Metrics' worksheet
objExcel.Sheets("Risk, Issue Metrics").Select
objExcel.Cells(9, 1).Value = "No. of minor risks open (i.e. with risk
exposure between 3.5 and 0)"

'A subroutine is located in the same worksheet. This needs to be updated
with a new code here
'How do it do it?

'Save updated excel sheet and close it
objExcel.Workbooks(1).Save
objExcel.Workbooks.Close
objExcel.Quit
Set objExcel = Nothing
End Sub

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Call a subroutine using variable subroutine name dhstein Excel Discussion (Misc queries) 3 July 26th 09 08:28 PM
call excelsheet within excelsheet when user clicks excelsheet ico mohini Excel Worksheet Functions 0 November 20th 06 05:07 AM
How do I exit a macro subroutine? John Excel Worksheet Functions 1 January 15th 06 02:08 AM
How can i get autoformat name of range in excelsheet? classpeople Excel Worksheet Functions 0 June 22nd 05 03:16 PM
How to enter an excelsheet from a ppt presentation? Jan Hofste Excel Discussion (Misc queries) 1 March 24th 05 06:17 PM


All times are GMT +1. The time now is 10:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"