Firing A Macro On Selecting Specific Sheet
The subject says it all really.
How can I get Excel to fire a macro when one of the sheets in my workbook is selected?
Thanks
Francis Neil Beans
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Opening Excel, Selecting Book / Sheet - Read/write Data To/from Specific Cell Usinf WIN 3A
Please can someone inform me how to do the following using Win32 API functionds onlyl;
1) open excel
2) open a named bookbook and select specific sheet
3) read or write an entry into or out of a specific cell;
I have opend other programs before from a VB6 environment using shell execute statement, however in this problem I am not using VB6, rather a prorietary programming language that allows me to have access to WIN 32 API functions - so my problem has to be solved using these functions only.
Any one's help on this probelm is greatly appreciated.
Regards
adam
Preventing Another Macro From Firing
I am writing a macro that takes another worksheet and copies it, formats and prints it. But there is another macro in this sheet that keeps firing every time I ACTIVATE the sheet. Can I prevent that macro from firing? (Unfortunately, I can't open it and disable all its macros.)
A Sheet's Number Or A Sheet's Name Using A Macro
Hi,
I have searched for a way to let a macro copy a sheet and move it to (before) a special sheet - let's call it "Special".
The code Sheets("Origin").Copy Before:=Sheets("Special") worked fine for some days but not any longer.
When a macro records this it writes
Sheets("Origin").Copy Before:=Sheets(4)
where 4 stands for sheet number 4 (even if sheet 3 is hidden). Sheet number 5 is then "Special".
It is a complicated to use the sheets' numbers instead of the names I have given them. Any move of a sheet makes the macro not work as intended and I also have the intention to let a macro copy and rename sheets so keeping track of the numbers will be tough.
Do you know a way how solve this? Thanks in advance!
Edited by - benes on 12/10/2006 9:09:09 AM
Selecting A Sheet
Hi guys,
Having a bit of trouble getting some code to work. I'm new to this caper, so any tips on neatening up my code
and the like would be greatly appreciated.
I'm using Visual Basic for excel in office 2000 and what I'm trying to do is to activate a sheet in an open workbook.
The sheetname is entered via an input box and if the sheet name is entered incorrectly I want an error message to
come up letting the user know and give them the option to re-enter the sheet name. Here is the code I have for it:
Code:
8 freightsheet = InputBox("Please Enter the name of the sheet that the freight information_
is located on in the file " & freightfile, "Sheet Name", "Sheetname")
If freightsheet = "" Then End
On Error GoTo 16
Sheets(freightsheet).Activate
On Error GoTo 0
16 response = MsgBox("The sheet name you selected could not be found in the workbook "_
& freightname & ". Click 'Yes' to re-enter the sheet name or click 'No' to exit.",_
vbYesNo, "Incorrect Sheet Name, File Name Combination")
If response = vbYes Then GoTo 8 Else End
It works for the first loop, but if it is entered incorrectly second time around an error message comes up:
"Run time error '9':
Subscript out of range."
Selecting A Specific Tab
Hi,
I'm trying to select names from a worksheet (Column A) and match each of these names against a second workbook. The second workbook has several tabs with each one respresenting the name of a person from column A.
For example; Column A has the names Smith, Jones, Prior, Ryan
I would like the macro to select each name and open the open that persons tab in the second workbook. The code would select Smith and search for the tab with the name "Smith".
The code I have so far is very crude and I can't get it to work. I would greatly appreciate any help in solving this problem.
This is what I have so far;
Public Sub FindTab()
Dim TabName As String
Dim EmpName As String
Dim ReturnValue As Integer
EmpName = Range("b1").Value
TabName = "='C:[Workbook B.xls]" & EmpName & "'"
Range("c2").Value = TabName & "!A1"
End Sub
Thanks very much.
Selecting An Excel Sheet With VBA
i have this bit of code below in access97 which does not work. All i want to do is select a sheet in excel without actually hard coding the name in hence the strName string. strName holds the correct name but if i put it in the 2nd line below i get a subscript out of range error ? Am i missing something ?
Can anyone shed any light on this for me ?
strName = Left(outputName, Len(outputName) - 4)
XLapp.Sheets(strName).Select
thanks
Paul
Selecting Specific Row From The Datagrid
Hello
i am using datagrid in my program to show all the record in the database
i am not being able to find the way that i click on one row and the record on that row come in the textboxes
tell me the easiest way and with simple example
thankyou
Selecting Specific Cells
Hi,
I wonder if anyone can help me, I have writen a macro in excel for a report, but I am having trouble figuring out how to select cells with specific data in them, cut them and paste them into another sheet, I get the cutting and pasting part, but the cells are not constant they change everytime the report is run off (twice a month).
Could anyone give me a n idea of where to look for the answer, I have tried various other places and short of spending hundreds of pounds on x number of books, I am stuck.
If any one can help I can explain further.
Thanks in advance
kat
Selecting Specific Web Text
I would like to select text from THIS WEBSITE. Specifically from the NWS Zone Forecast Section. I was wondering how i could select this text and then place it into a variable for writing to a file. (I need to put that 1 section of weather forecast into a text file.) Any help would be appreciated.
Selecting Excel Sheet Range
Hi, I need to select the range between two columns.
The first range is TwoDRangeB = 17 ' Range Begins Cell 17
The 2nd range is TwoDRangeE = 27 ' Range Ends Cell 27
They both belong to the same column, per say "A"
How can I select this whole Range using these Variables?
I am using this format, but it does not work:
Code:
Range("TwoDRangeB:TwoDRangeB").Select
I get a message: Run_Time Error '1004'
Method 'Range' of Object '_Worksheet' Failed
How can I assign these values to belong to Column A?
Thank you
Selecting From Record Sheet Where Value Is An Autonumber
Hi, i am using the below code
rs.Open "select * from Customer where ID= '" & txtID.Text & "'", Conn, adOpenKeyset, adLockOptimistic
and it works fine, providing the values in ID (access database) are "text", if i put them as "autonumber", i get an error????
Any ideas??
Thanks
Andrew
Selecting Excel Sheet Range
Hi, I need to select the range between two columns.
The first range is TwoDRangeB = 17 ' Range Begins Cell 17
The 2nd range is TwoDRangeE = 27 ' Range Ends Cell 27
They both belong to the same column, per say "A"
How can I select this whole Range using these Variables?
I am using this format, but it does not work:
Code:
Range("TwoDRangeB:TwoDRangeB").Select
I get a message: Run_Time Error '1004'
Method 'Range' of Object '_Worksheet' Failed
How can I assign these values to belong to Column A?
BTW: I am using Si_The_Geek's Tutorial as usual.
Thank you
Displaying Form On Selecting Sheet
Hello.
I'm using excel 2000.
I want to display a form (frmSummary) when a certain sheet is selected ("Report") and hidden when a different sheet is selected.
Ive looked at the WorkSheet_Activate event and added
Code:
frmSummary.Show
which works fine. But can't find a way to get rid of the form when another worksheet is selected.
Also i'd like the user to be able to click on and change data on the worksheet when the form is visible and keep the form on-top.
thanks.
bob.
Selecting A Specific Word Table?
I need to be able to access a table in word using vb6. I know how to access data in a table by using the Table(1) feature, but i need to be able to access the table without knowing where it exists in the document prior to running my tool. For example, the table i need may be the first table in the doc one time and then be the third table the next time. So i thought maybe i could trigger off of the caption somehow. Any ideas? below is how i am currently doing it.
If curTable = 1 Then
Count = 1
endOfTable = False
curTableString = "TableOne"
Set tblOneData = New Tables
While Not endOfTable
UpdateActivityBar ProgressBarActivity.ActiveBar, 0.1
Count = Count + 1
If Not endOfTable Then
endOfTable = wrdDoc.Tables(curTable).Rows(Count).IsLast
End If
Wend
.
.
and so on.
Selecting Specific Worksheet Names
Not sure where to put this question.
How do I select specific worksheets in an Excel file that include the characters "CF" with other characters undetermined. For instance, the sheets will be named "11 CF", "12 CF", "12 BB", "13 DB" and I only want to select the sheets with "CF" included as a name; however, additional sheets will be added at a later date which might be "13 CF" which I would want included at that time without modifying my VBA macro.
Thanks so much!!
Selecting Specific Worksheet Names
Not sure where to put this question.
How do I select specific worksheets in an Excel file that include the characters "CF" with other characters undetermined. For instance, the sheets will be named "11 CF", "12 CF", "12 BB", "13 DB" and I only want to select the sheets with "CF" included as a name; however, additional sheets will be added at a later date which might be "13 CF" which I would want included at that time without modifying my VBA macro.
Thanks so much!!
Selecting Specific Fields From A Table
I want to display fields from an Oracle table in a dropdown combo box. I'm doing a SELECT * FROM the table name, and then populating the combo box as follows: (Where FieldsRs is my recordset object)
Dim i As Integer
Dim iFieldCount As Integer
iFieldCount = FieldsRs.Fields.Count
For i = 0 to iFieldCount - 1
cboStationRef.AddItem FieldsRs.Fields(i).Name
Next
This does a sterling job of populating my combo box with all the fields in the table, however, I don't want ALL the fields. There are 98 fields in the table names Attrib01 through Attrib99. There are 21 other field names in this table that I don't want in the combo box. I don't want to build an SQL statement that does a SELECT Attrib01, Attrib02, Attrib03, etc through Attrib99 because, in all likelihood, more attribute fields will be added, and I want my code to accommodate them without having to make any coding changes. Finding the index of each combo box item won't do any long-term good in so far as the index for each item will change as the fields in the table change. Any suggestions?
Specific Excel Sheet To View In VB6??? (using Ole???)
Hi,
Here is my problem:
I'm creating an easy app ('cause it's for school )
BUT I have to show a specific sheet out of a saved workbook on a form.
I am currently using Visual Basic 6 and I am trying to get the sheet in a OLE object ...
Opening a workbook file works,
but I can't select a specific sheet
Currently I use this code to open the .xls file:
Code:
Private Sub mnuFinancieelPandoraMaintenanceCost1999_Click()
OLEObject.CreateLink App.Path & "filesFinancieelPandoraMaintenance
Cost.xls", "jaar1"
OLEObject.SizeMode = 0
OLEObject.Refresh
End Sub
The string "jaar1" in createlink is a reference created in excel on the second sheet ... But the it keeps showing the first (or the active sheet the file was saved the last time)
I hope you can help me, this is my last hope...
Open Workbook To Specific Sheet
Why do I get a "Subscript out of range error" with the following code?
Code:
Private Sub Workbook_Open()
Worksheets("Sheet1").Select
Range("C6").Select
End Sub
All I'm trying to do here is whenever the workbook is opened, it will always open with Sheet1 displayed.
Display User Form When Selecting A Sheet
Hi, i want to display a user form when i select a sheet, at the moment i'm usind the right_click event, just like this:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
UserForm2.Show
End Sub
But i would prefer to display the userform when selecting the sheet.
thank you for your time ;-)
pacho
Selecting Newest File In A Specific Directory
I cannot figure out how I would go about selecting the newest file in a directory to pass on to another routine. Every night my system downloads data into different directories and I need to be able to select the newest data for input to a spreadsheet. Any help would be appreciated.
Selecting Specific Number Of Records Returned?
I'm trying to retrieve a specific number of records from a database query. Currently I am getting all of the records and then just putting the last 5 into my datagrid. What I would like to do is rewrite the query so that it only returns the number of records that I am looking for.
For example, if ID number 5 has 100 jobs entered into the database, I don't want to select all 100 jobs. I just want to return the last 5 jobs (based on a DESC custID field) in the jobs table.
Here is the code I am currently using to select all of the records. How would I go about rewriting this??
Code:
Set rsGetLastJobs = New ADODB.Recordset
rsGetLastJobs.Open "Select * From tblJob Where custID = " & intCustID, conCustomer, adOpenDynamic, adLockOptimistic
Does anyone have any idea's on how I would re-write this?
Thanks in advance.
DTFan
Select A Specific Sheet When Opening Spreadsheet
Hello All,
Happy New Year.
I want excel to be able to select my "Menu" sheet when I open the spreadsheet. Could anyone please provide some guidelines as to the best way of implementing some code to do this.
Thanks
Open Excel File With Specific Sheet
Hello to all developer
I want to open a excel file with specific sheet. For ex.
I have a excel file with name : products and it has a 3 sheets namely
monitor , UPS , Processor.
and I want is to open the excel file and automatically show the UPS sheet..
anyone knows this please help.
Thanks
Joseph
Blank Property Sheet After Selecting Data Source?
Hi all,
I've been getting this odd problem on both the standard VB ListBox's and Sheridan Data Grid's when I try to select a Data Source for either. The (F4) property sheet (not the property pages that come up when right clicking on the Sheridan Grid) become blank. There's some blinking on the screen and then the sheet is totally blank. There are valid Data control's on the form.
Has anyone seen this behaviour or know what can correct this? Thanks,
--Jim
Selecting A Specific Date With VB (Evey Friday Of That Week)
Hello everyone,
I am working on a project that requires me to select a specific date on a calendar. What I want to do is whenever I open up an excel file, I would like to display the date for the following Friday. For example, if I open the file today I want it to show 4/6/07 on the calendar; if I open it up on 4/10/07, I want it to display 4/13/07 on the calendar. I have no code to post because the way I am doing it now is for the user to select the date from the calendar and it displays whatever date is selected with the Calendar1.Value = Now() code. Can anyone help?
Many Thanks.
-Caros
Can't Open Specific Sheet From Closed Workbook, I Get Eror's! PLEASE HELP!?!
Helo... i have a problem with VBA in excel...
ok the point is this... i was traying to make a buton, which detects some date infromation and apon them, when i click the buton some specific workbook would open and specific sheetfor 4 weeks in a month) and in every workbook i have 6 sheets(for 6 working days in a week) ... and when i use some if statements i can do that wehn i type only 3 or 4 od them, but when i type more of them i get Run time error '9' ... bla bla...i searched the web and google, and always the same answer,that maybe my sheet is wrong named,but it isn't i checked it 10 times and more... so i can paste you how this looks like ... and if someone nows where the problem is please tell me, HELP ME!!
Private Sub CommandButton1_Click()
a = Range("i12").Value
b = Range("i16").Value
If a = 1 And b = 1 Then Application.Workbooks.Open ("C:UserspathDocumentsxxxRuckstandRuckstandEintrag.xlsm")
Worksheets("PONEDELJEK-Motag").Select
If a = 1 And b = 2 Then Application.Workbooks.Open ("C:UserspathDocumentsxxxRuckstandRuckstandEintrag.xlsm")
Worksheets("TOREK-Dienstg").Select
If a = 1 And b = 3 Then Application.Workbooks.Open ("C:UserspathDocumentsxxxRuckstandRuckstandEintrag.xlsm")
Worksheets("SREDA-Mitwoch").Select
If a = 1 And b = 4 Then Application.Workbooks.Open ("C:UserspathDocumentsxxxRuckstandRuckstandEintrag.xlsm")
Worksheets("ČETRTEK-Donnerstag").Select
If a = 1 And b = 5 Then Application.Workbooks.Open ("C:UserspathDocumentsxxxRuckstandRuckstandEintrag.xlsm")
Worksheets("PETEK-Freitag").Select
If a = 1 And b = 6 Then Application.Workbooks.Open ("C:UserspathDocumentsxxxRuckstandRuckstandEintrag.xlsm")
Worksheets("SAMSTAG-Sobota").Select
If a = 2 And b = 1 Then Application.Workbooks.Open ("C:UserspathDocumentsxxxRuckstandRuckstandEintrag2.xlsm")
Worksheets("PONEDELJEK-Motag").Select
If a = 2 And b = 2 Then Application.Workbooks.Open ("C:UserspathDocumentsxxxRuckstandRuckstandEintrag2.xlsm")
Worksheets("TOREK-Dienstg").Select
If a = 2 And b = 3 Then Application.Workbooks.Open ("C:UserspathDocumentsxxxRuckstandRuckstandEintrag2.xlsm")
Worksheets("SREDA-Mitwoch").Select
If a = 2 And b = 4 Then Application.Workbooks.Open ("C:UserspathDocumentsxxxRuckstandRuckstandEintrag2.xlsm")
Worksheets("ČETRTEK-Donnerstag").Select
If a = 2 And b = 5 Then Application.Workbooks.Open ("C:UserspathDocumentsxxxRuckstandRuckstandEintrag2.xlsm")
Worksheets("PETEK-Freitag").Select
If a = 2 And b = 6 Then Application.Workbooks.Open ("C:UserspathDocumentsxxxRuckstandRuckstandEintrag2.xlsm")
Worksheets("SAMSTAG-Sobota").Select
'and so on for two more like this for week 3 and week4 ..
End Sub
___________
please help i need this for my job and i can't get it done for the hole day and more...
Edit by Moderator:
Please post Excel questions, in the Excel forum.
Thank you.
Selecting Tabs In Macro
Hope someone can help.
Created macro for a master workbook to select all but 1 sheet to be printed. Problem is that sheet tabs have specific names (1 for each employee) that I set to print out as the header & sheets are added & deleted periodically as employees come & go. Is there a way to select all sheets no matter what they are named?
Please answer in layman's terms or feel free to post correct code.
See my code below:
Sub Print_all()
'
' Print_all Macro
' Macro recorded 3/12/2008 by 03242957
'
' Keyboard Shortcut: Ctrl+p
'
Sheets(Array("Building Detail", "Building Scorecard", "005", "024", "065", "107", _
"110", "114", "124", "136", "138", "154", "155", "164", "168", "171", "195", "196", "197", _
"202", "204", "205", "206", "207", "208")).Select
Sheets("Building Scorecard").Activate
Sheets(Array("Sheet5", "Sheet4", "Sheet3", "Sheet2", "Sheet1")).Select Replace:= _
False
Sheets(Array("Building Scorecard", "005", "024", "065", "107", "110", "114", "124", _
"136", "138", "154", "155", "164", "168", "171", "195", "196", "197", "202", "204", "205", _
"206", "207", "208", "Sheet5")).Select
Sheets("Building Scorecard").Activate
Sheets(Array("Sheet4", "Sheet3", "Sheet2", "Sheet1")).Select Replace:=False
Application.ActivePrinter = "\peppsa00168PEPPRT02861 on Ne04:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"\peppsa00168PEPPRT02861 on Ne04:", Collate:=True
End Sub
Thanks in advance
Run Macro When Sheet Is Selected
Is there anyway I can run a macro when a user selects a certain sheet.
I know it's possible to do things on file open and close. I've tried using application.volatile, but that only works on recalcuatlions on sheets in which that function is used, selecting a different sheet is not a calculations.
I know code I want to run when the sheet is selected, i'm just a little unsure on how to make it run when sheet1 is selected.
Macro To Save Only One Sheet
Hi everyone its me again sorry for all the newbie questions
i am trying to make a macro that will save a hidden sheet i have. if i manually open the sheet and go save as it does it fine but if i use a macro all it does is save my workbook which is just a menu.
ActiveWorkbook.SaveAs Filename:= _
"C:Documents and SettingsAdministratorDesktopTeam1Peroid1.prn", FileFormat _
:=xlTextPrinter, CreateBackup:=False
what i would like instead of this is something like
Sheet("name").saveas filename .... but this dosint work or compile
thanks for any help any of you can provide.
Selecting A Range While A Macro Is Running
I have a vba macro that transfers data between two spreadsheets.
The macro works; however, it would be better if the user could select the range to transfer while the macro was running.
Currently, before the macro is run, 1) the source sheet must be selected 2) the source range on the source sheet must be selected 3) the destination sheet must be selected.
Code:
FunctionTransferData(lRowDestination as Long, nCol as Integer, strSource as String) as Boolean
'lRowDest is the destination Row in the Destination Worksheet
'nCol is the column being transferred
'strSource is the path to the source workbook
Dim appXL As Excel.Application
Dim lRow as Long
Dim lRowDest as Long
Dim lRowFirst as Long
Dim lRowLast as Long
Dim objSourceWB As Excel.WorkBook
Dim objSourceWS As Excel.Worksheet
Dim objDestinationWS As Excel.Worksheet
Dim rngSource as Excel.Range
Set appXL = Excel.Application
'Debug.Print objWB.Name
Set objDestinationWS = appXL.ActiveSheet
Set objSourceWB = appXL.Workbooks(strSource)
Set objSourceWS = objSourceWB.Worksheets("Data")
objSourceWS.Activate
Set rngSource = appXL.Selection '<--------requires the selection to be made before the macro is run
lRowFirst = rngSource.Row
lRowLast = lRowFirst + rngSource.Rows.Count - 1
lRow Dest = lRowDestination
For lRow = lRowFirst to lRowLast
objDestinationWS.Cells(lRowDest, nCol) = objSourceWS.Cells(lRowDest, nCol)
lRowDest = lRowDest + 1
Next lRow
objDestinationWS.Activate
Set rngSource = Nothing
Set objSourceWS = Nothing
Set objSourceWB = Nothing
Set objDestinationWS = Nothing
Set AppXL = Nothing
End Function
Is there a way to select a range while a macro is running?
It would seem execution must be paused, the selection made and the execution continued.
Any help would be appreciated.
Selecting First And Last Rows Excel Macro
The second part to a post that I made early involves creating a macro that will select the first and last date/time stamps from a Excel log file. In colum A there are employee names. In column B there are date/time stamps from the event log on the file server. It looks something like this
What I need the macro to do is copy the first time and last time for each employee and paste those two values to column D without any blank rows in between. So from this screen shot column D would be:
6/11/2007 8:54:48 AM
6/11/2007 8:28:03 AM
6/11/2007 8:42:36 AM
6/11/2007 8:40.02 AM
6/11/2007 8:33:27 AM
6/11/2007 8:29:39 AM
Any help would be great!
How Do I Run A Macro At A Specific Time
I am using MS ACCESS 2000 and want to have a SendObject macro run each day at midday, i have been told it is possible although i cannot find out how.
Any Ideas?
Regards
Matt
Run Macro At Specific Time
At 3:00pm daily, I want to output "DONE" in a specified cell. However, I cannot get the OnTime method to work automatically. Do I need to create an event? I have a subroutine that simply outputs done to a cell:
Sub fillCell
Range("E4").Value = "DONE"
End Sub
How do I run this automatically at 3pm? TIA.
Run Macro On Specific Day Of Week
looked everywhere for a simple solution... none to be found
Just want to do the following:
Code:
If Weekday = Saturday then...
'Run this code
End if
I have looked in MS Help, Mr. Excel, MSN.com & Here...Nothing
Any help would be appreciated
Thanks
Run Macro At Specific Time
Hi,
I was wondering if you can run macro's in excel automatically at a certain time?
Cheers
White Magic
Starting Macro When A Specific Value Changes
I want to start a macro when in a specific cell a value is entered or changed.
If tried this:
vb
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("b27").Value > 0 Then
Call hydraulic_nut
End If
End Sub
Sub hydraulic_nut()
Dim S As String
S = WorksheetFunction.VLookup(Range("b27").Value, Sheets(3).Range("A2:B45"), 2, False)
Range("b28").Value = S
End Sub
vb
But the program gets very slow when i start an other macro (which put many results of the sheet)
What is the solution?
Maarten
End A Loop Macro At A Specific Row??
Ok here is the deal. I want this macro to loop until it hits row 515, no matter what is in the cells. Right now of course it keeps going until it finds an empty cell. Any ideas??
Do While ActiveCell.Value <> ""
ActiveCell.Offset(1, 0).Range("A1").Select
Selection.Cut
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(1, -1).Range("A1").Select
Selection.Cut
ActiveCell.Offset(0, 2).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(1, -2).Range("A1").Select
Selection.Cut
ActiveCell.Offset(0, 3).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(1, -3).Range("A1").Select
Selection.Cut
ActiveCell.Offset(0, 4).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(1, -4).Range("A1").Select
Loop
End Sub
Thanks,
Michael
Problem In Macro Changing Sheet.
Hi,
I wish to use a macro when a sheet change (for example deleting a column).
I use this code.
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim i As Integer
Dim a1 As Variant
For i = 1 To 6
a1 = Sheet1.Cells(1, 1)
If i = 4 Then
Sheet2.Cells(2, 2) = i
End If
Next i
End Sub
I wish that my loop end after 6 steps but if I delete a column on sheet1, the macro starts and after setting the value in sheet2, starts again at the beginning of the loop.
Is it possible to continue after Sheet2.Cells(2, 2) = i ?
Any idea?
Thanks in advance.
Regards,
Giovanni
VB6.0: Find Excel Sheet With Macro
I am trying to build a small Visual Basic application (VB6.0) that will loop through a folder and pick out all the Excel files.
My question is--How can I programmatically tell if a particular Excel file contain Macro?
Please help me out.
Thanks in advance.
How To Delete A Saved Sheet From Within A Macro
I have a macro that opens a saved CSV file and then saves a copy as a XLS. The problem is that this process asks for permission to overwrite an existing file with the same name. It's OK to overwrite, I just want to eliminate the request for permission as I want this to be totally automatic without any user intervention. Is there a command that will allow this?
Open Another Excel Sheet In A Macro
Is it possible to open another excel sheet in a macro?
I want to copy data from one excel sheet to another
I tried this in abc.xls but it errors out
Code:
Private Sub comp()
Dim xlTmp As Excel.Application
Set xlTmp = New Excel.Application
xlTmp.Workbooks.Open "xyz.xls"
End Sub
Please help
Run Macro On Specific Cell Change
Is there a way to have a VB Macro run when a specific cell changes value ? I am able to have a macro run when a "sheet data change" takes place, but do not know how to isolate a specific cell to be watched, while ignoring any other changes to the sheet.
Thanks in advance for any help !!!
|