Email:      Pass:    Pass?


Advertisements


Free Excel Forum

Select Sheets Using Vba Whose Name Contain Specific Word (word From Variable)

Forum Register
Search Excel Forum Posts, Tutorials, Macros, Tips, and More

Select sheets using VBA that contain specific word (word from variable).

I want to select all sheets in active workbook whose name contains a specific word. I getting such specific word from variable.

Thanks
Amir

Similar Excel Video Tutorials

Helpful Excel Macros

Open Microsoft Word from Excel
- This free macro will open the Microsoft Word program on your computer. You do need to have this program first. This wi
Open a Word Document from Excel
- This Microsoft Excel macro will open a Microsoft Word document from excel. With this macro, you can open any word docume
Extract a Word from a Sentence / Cell in Excel with this UDF - Allows for a User-Defined Delimiter
- Extract whole words from a cell or sentence in Excel with this UDF. This allows you to specify which word from a cell y
Extract the First Word from a Cell in Excel - User Defined Delimiter Text Extraction - UDF
- This free Excel UDF (user defined function) returns the first word from a cell in Excel. This extracts the first word f
Capitalize the First Letter of Every Word in a Cell
- This macro will make the text of any selected cell in excel proper case. This means that the first letter of any word in

Similar Topics







Hi all
I hope U can now help me on this issue..
I need to find specific word, for example tab with previous word, which is variable.
For example. I have doc where I have a lot of words like Home tab, Insert tab, Page Layout tab and so on.

So How can I select all word tab with previous word
I tried to use this *([A-Z]@1) ?Tab> but it didn't help.

Any help is greatly appreciated....


Hi,

I have a macro and at one part of it I need it to do the following:

Input

Column C

word word word
word word
word word word word
word word
...

Output

Column F

word-word-word
word-word
word-word-word-word
word-word
...

As you see, I want to replace the spaces, " ", with "-". Thanks in advance.


Hello out there -
Here i am asking for more asistance, again.

I would like to copy the words in one column repeat them 8 times each and add a number to the end of each word that increments. The revised list can stay in the same column, just need to be able to do how ever many words are in the original column.
Thanks in advance--

EXAMPLE:

Any Word Any Word 100 New Word Any Word 200 Next word Any Word 300 Any Word 400 Any Word 500 Any Word 600 Any Word 700 Any Word 800 New Word 100 New Word 200 New Word 300 New Word 400 New Word 500 New Word 600 New Word 700 New Word 800 Next Word 100 Next Word 200 Next Word 300 Next Word 400 Next Word 500 Next Word 600 Next Word 700 Next Word 800


I know the title is confusing, but I don't kow how to describe this otherwise.

Here is the challenge I'm facing:

I have a list of synonyms in word in the following format:

A B C D
word A1 Word A2 Word A3 (<-- all A-words are synonyms from each other on the same row)
Word B1 Word B2 Word B3 Word B4 (<-- all B-words are synonyms from each other on the same row)



Now I need the following output:
Word A1 Word A2
Word A1 Word A3
Word A2 Word A1
Word A2 Word A3
Word A3 Word A1
Word A3 Word A2
Word B1 Word B2
Word B1 Word B3
Word B1 Word B4
Word B2 Word B1
Word B2 Word B3
Word B2 Word B4
Word B3 Word B1
Word B3 Word B2
Word B3 Word B4
Word B4 Word B1
Word B4 Word B2
Word B4 Word B3


If I try to explain it in words: I need all combinations of synonyms in pairs formatted in rows.

I need this for a piece of software which allows import of synonyms, but the format has to be as above (each synonym on a row, in pairs).

How would I accomplish this in Excel?

I've uploaded an excel file with an example and on the second worksheet the complete synonym list (in foreign language, but that shouldn't matter)

You can find it he
http://rapidshare.com/files/269768819/synonyms.xls.html

I would appreciate it very much if someone can offer me a solution.

Kind regards,
Erik


Hi,

I have a spreadsheet that I have variable data in and I want to transfer specific parts of the workbook into a Word doc.

Not a problem with the Excel part, I can select each and every cell that I want, copy them and then... yeah.

Recording a macro hasn't done the trick as the code I have only copies and doesn't paste. I know I can edit the code to open Word but the problem is that when in Word, the data needs to go to very specific places, some of it goes in the header, most goes in the main body, I can't see how this could be done as there are no cell refs as in Excel!

So my question is that is it possible to paste to say halfway in a sentence, in a macro?


I have a s/s and need to search for a specific word in a specific format to ascertain the number of times it appears.

For instance the word could be [Billy].

It must have the correct brackets, upper and lower case letter in the correct place.
The word could appear anywhere with a cell

I do not want to count things like [billy] or [Billys]

Is this possible? If so how?


I have code that lets me find a specific word in a cell. Now I need to be able to select the entire line that specific word is on.

I need to do this without the use of specific ranges, because the words I'm searching for, and subsequently finding, will not be in the same rows or columns every time.

Thanks in advance.


I use excel '08 for Mac, and would like to hyperlink a word/phrase to a specific word or pdf document on my computer.

Here's what I do: right-click the word/phrase in the cell, click "hyperlink," and select "document" then click "ok"

Here's what happens: although the word then appears hyperlinked, when I click on it I get the message "cannot open that specific file".

Any suggestions? Thanks in advance, Nate


I am trying to link to a specific location in a word doc from Excel.
Can I add something to the hyperlink to find a string of text in the
word doc. Or run a macro, open the word doc and then search for a
string of interest?, etc?? Suggestions?




Hello guys and gals,

I'm stuck with trying to extract a specific word from a cell that contains a long string with
variable length. To add to the misery, the position of the word within the line is also not fixed. Come one, excel vba/function geniuses! help out plz.

As an example, suppose the cell contains a sentence,"What is your name" and i want to extract the word "name" into a cell. But this is a long list and the position of the word name is different in some cells.

So, I need a function that extracts using left, mid, or right function, based on finding the word "name".
Also the positive point is that the word that i need to extract is exactly the same so it is of fixed length.

I hope the problem has been adequately explained.


Thanks and warm regards,

Offeror


Hi,

I need a macro which gets n variables from word document, finally give me a output in notepad.

For instance..
the word table looks like below.
Variable Name Description Value
------ DUT_MD_303
------ DUTMD303
File Location ------ N: \CSTeam\EDC_V2\MD_Studies\DUT_MD_303
StudyByComponen_DUT_MD_303_TE.rsp
StudyByComponen_DUT_MD_303_Rules.rsp

there are many other tables in word document but we need to get the above listed variables. and specific variable from spreadsheet.. which has lot of data..


Using the code in this post http://www.mrexcel.com/forum/showthr...l+word, I can automate exporting to word with a range of cells. How do I alter the macro to export to a specific word file? The word file has set margins. How do I make the exported image fit the margins in the word document automatically?

Thanks


I am trying to test for a specific word in a specific cell to determine the formatting of the data that follows. Any thoughts on how to proceed?

For example, I am trying to determine if cell A60 has the word Trend or the word Resistance


Hi,

I have some trouble creating a macro. I'm new with VBA and I want a macro that does something specific.

I have 2 workbooks (WB1 & WB2). WB1 will be the one that will record all the information that I need, while WB2 is the one in which I'll be looking for specific information.

In WB2 I have 4 worksheets. I need to find out how many times the word written in cell A3 is repeated in column A. After doing the count I need to write that word 28 times for each time it was found in column B, starting in cell B2. That is, if the word count was 1, then I should have 28 copies of the word from B2 to B29. If the word count was 2, then I should have 56 copies of the word from B2 to B57, and so on.

I really don't know how to do this and I wanted some help.

Thanks in advance.


Hello,

I would like to ask you for little help =( I am a newbie in VB programming and now I am dealing with serious problem. I can’t handle probably very basic command. I am googling for more than one week and I didn’t find any solution =(

My situation:
I have already opened my excel workbook and word document A, word document B, and many others Word documents (all those are open before I run this macro).
Macro take value from cell A1 and if value is 1 then (No probl)
somehow activate document A and write there "Some text in doc A" (Big probl)
In the case the value in A1 is different, then activate document B and write there "message for B"

I have real problem to select one specific document that I want to work with.

Code:

  Sub LALA()  
  Dim wdApp As Word.Application  
  Dim wdDoc As Word.Document  
  Set appWD = Getobject(, "Word.Application")  
 
    ‘I tried to use: Set appWD = Getobject("C:/Folder/A.docx", "Word.Application")   
  ‘but it doesn’t work. Runtime error 432: File name or class name not found during Automation operation  
 
appWD.Visible = True  
  If Sheets("MyWB").Range("A1").Value = 1 Then  
      (something to select doc A)  
      appWD.Selection.TypeText Text:="Some text in doc A"  
 
 
  Else  
      (something to select doc B)  
      appWD.Selection.TypeText Text:="message for B"  
 
  End If  
  End Sub  




Any ideas?

Thank you for help


I have been having trouble locating a specific word. It is not that I can't find it, but it contains a word within a word.

Let me explain.

I'm using the
Set r = Cells.Find("LOAN")

However, There may (or may not) be the word(s) "LOANID" or "SLOAN" located in the columns before finding "LOAN"

How can I have the macro specifically find what I'm looking for?

Thanks in advance,

-Robert


I use excel to launch other applications like PowerPoint and Word. I can specifically go to a PowerPoint Page when I open it from Excel. How do I go to a specific page of a word document that I have just opened from Excel?

Here is some code that I currently use (That works great).
setup: Shx is a sheet or slide number, Tx is used as an idicator of file type.

This opens a PowerPoint file and goes to a specific slide.
If Tx = "File.ppt" Then
If IsNumeric(Shx.Value) Then
Set PPT = GetObject(Px & Fx)
PPT.Application.Visible = True
PPT.Application.Activate
If Shx > 0 Then Set Slide = PPT.Slides(Shx.Value)
Slide.Select
Exit Sub
End If
End If

Here is what I have for the Word document. This one will not goto a specific page like the one above. (This does not work).

If Tx = "File.doc" Then
Tx.Select
Set Word = GetObject(Px & Fx)
Word.Application.Visible = True
Word.Application.Activate
If Shx > 0 Then Word.Goto Shx.Value
Exit Sub
End if


Hi,

How do I restrict a specific word in any specified column, for example :

If any specific word is written in those desired columns where it is restricted excel should throw a error ... is there any way to put a validation for such event ???

Please help.


Hello, I am having a problem looping through a range.

I have a range name called summary_object_codes

And what i want to do is loop through each cell in that range.

my code so far is

The problem is i cant seem to select the cell C

i tried c.select but didn't work - I am sure there is a way - but i can't seem to do it


Sub summary_totals()

Dim c
Dim word, codenumber, PLname, newrownumber, totalentered

For Each c In Application.Range("summary_object_codes")
Sheets("Assisting Sheet").Select
Range("summary_object_codes").Select

word = c 'this just assigns the value in c to the variable word
codenumber = c.Address.Offset(0, 1).Value ' i am trying to assign the value in the cell next to c to the variable codenumber


etc...



Thanks a lot
Jonty




Dear Friends,
I want a code which copies the values from excel to a table in word.
Independently i have written a code in word which does the task of filling a table. but now i want the value from excel to word.
could any one help in knowing how can i use the variable value in excel to word programming.
Hope i am clear.


thank you very much in advance.


regards
yeshwant

I was hoping someone could help me with this.

I have a large range of data and on each row the cells contain either 0, 1, No or another word. I would like to display the other word at the start but im really stuck on how to do it. This other word can change on each row but each specific row will only have one word.

I can post a sample spreadsheet if necessary.

Any advice would be greatly appreciated

Cheers


What I am trying to do is create an excel spreadsheet where the following happens. When someone types something specific in the field (i.e. Lease) A specific document pops up to go with the selection. I created a VBA that allows the word doc to populate, but I can not figure out how to get it to run only when someone types something specific in a certain field? Below is the code that I am currently using.

Code:

Sub OpenWordDoc()
Dim wdApp As Word.Application, wdDoc As Word.Document
On Error Resume Next
Set wdApp = GetObject(, "Word.Application")
If Err.Number 0 Then
Set wdApp = CreateObject("Word.Application")
End If
On Error GoTo 0
Set wdDoc = wdApp.Documents.Open("N:\Touchtown.doc")
wdApp.Visible = True
wdDoc.PrintOut
wdDoc.Activate

End Sub


I require code to find a specific word in a column/sheet to add into my macro.

My current macro:-

Code:

Sub copypaste2()
ActiveCell = ("*Default*")
Rows("2:2").Select
Selection.Copy
	'Find the word *Default* in worksheet and make cell active
Selection.Insert Shift:=xlToRight
	'Find the word *Default* in worksheet and make cell active
Selection.ClearContents
End Sub


At the moment the macro will enter the word "*Default*" into the current active cell, then copy the entire contents of Row 2.
The next missing code will need to find the word "*Default*" in the sheet and insert the copied cells.
Then the next missing code again will need to find the word "*Default*" in the sheet and delete the contents of the cell so that when the macro is re-run the word *Default* is only found once.

Hopefully when the code is searching for the specific word the copy function is not cancelled.

Any help is appreciated, thank you.


I require code to find a specific word in a column/sheet to add into my macro.

My current macro:-

Code:

Sub copypaste2()
ActiveCell = ("*Default*")
Rows("2:2").Select
Selection.Copy
	'Find the word *Default* in worksheet and make cell active
Selection.Insert Shift:=xlToRight
	'Find the word *Default* in worksheet and make cell active
Selection.ClearContents
End Sub


At the moment the macro will enter the word "*Default*" into the current active cell, then copy the entire contents of Row 2.
The next missing code will need to find the word "*Default*" in the sheet and insert the copied cells.
Then the next missing code again will need to find the word "*Default*" in the sheet and delete the contents of the cell so that when the macro is re-run the word *Default* is only found once.

Hopefully when the code is searching for the specific word the copy function is not cancelled.

Any help is appreciated, thank you.


Hi,

I'm looking to search for a macro to search a selection for a specific word and then select the cell next to the word of interest (1 column along). The word I'm interested in finding is "of".

Many thanks in advance your help.