I have an Excel spreadsheet that is updated daily in a Document Library. The spreadsheet contains 5 worksheets.
I want to create a number of Excel Services webparts that show only certain worksheets e.g.
webpart 1 to display only Worksheet 1 & 2
webpart 2 to display only Worksheet 1 & 3
and so on
I cannot seem to be able to define which worksheets to publish from the spreadsheet. Searching in various documentation it suggests this should be possible. Wondered if anyone can advise how/where this is configured? I have tried entering worksheet names, Names Ranges, Cell ranges etc. in the Named Item field of the webpart properties but this gives an error to say the Named Item is not available.
Many thanks
Open the file in Excel 2010. Click on FILE > Save & Send > Save to SHAREPOINT > Publish Options. From the drop down, select SHEETS.
Uncheck the sheets that you don't want in the web part.
Hope this help.
Related
I have sharpoint site where I have uploaded the Excel.
I have few list each list have same excel hyper link..
What I want to perform..
In Excel I have some data, Onclick of first hyperlink I want to open same excel sheet but I want some row to be selected.
same I want when I click on other option it should open same excel but row should be different one slected.
I tried to acheive this using the Macros but not able kno, How i will configure for hperlink..
https://support.office.com/en-us/article/Quick-start-Create-a-macro-455512ef-3532-404e-b8dd-ea6589512c1b
The scenario: I have an Excel workbook with a macro that uses a template (from "C:\Users\User1\Desktop\1.xltx") to create customized sheets.
The problem: I need to make Excel to use the template from the same workbook - I have added the template as a separate sheet ("temp1"). I can't seem to figure it out, even though it's probably very simple.
The current code:
Set wks = Sheets.Add(After:=Worksheets(Worksheets.Count), Type:="C:\Users\User1\Desktop\1.xltx")
You probably don't want individual copies of the template for each user. If something on the template changes, you would have to update every copy.
Have you thought of talking to your SysAdmin and storing the template (1.xltx) in a common location with Read Only permission for the users?
I have a Word document that is "form-fillable", i.e. it has content control objects in it such as rich text and date picker content controls. I am looking to extract the data from specific fields into Excel. For example, every form has the project title, start date, and manager. I would like 1 row for that form with those three pieces of data. Eventually this will need to be done for a few hundred of these forms every few months, but for now I'd like to just start with one.
I envision having a button on the Excel sheet that will run VBA code to pull the data from the Word document, and populate the proper cells in the sheet. With the filepath for the Word doc being specified by the user.
I am new to VBA. How do I point my code at the right file, and then again at the specific field I need? Do I give the fields titles in the Word doc?
This is in MS Office '13
Your application is going to have a large number of specific details which are difficult to address without the specifics. To get started, here is some very simple code to get the Date from a drop-down in Excel from Word.
Note to work with Word, you need to create a reference to "Microsoft Word 15.0 Object Library" on the Excel side. Tools -> References in the VBA Editor.
When working across applications, it can help to write the VBA in Word and then move it over to Excel once you have the properties you want.
This VBA for the Excel side of the equation:
Sub GetDataFromWordFile()
Dim wrd As Word.Application
Dim file As Word.Document
Set wrd = New Word.Application
Set file = wrd.Documents.Open("test.docx")
Range("A1") = file.ContentControls(1).Range.Text
file.Close
wrd.Quit
End Sub
My Word file includes a single ContentControl. Not sure how you address the ones you want (trial and error?).
The Excel side drops the date in the right place.
I'm working on automating a workbook in Excel, and I'm running into a few issues with my VBA code. I'd paste it here, but I've been through so many iterations, it's pretty unusable.
The goal is to have the active book 'grab' the data out of several workbooks containing raw data when it is opened, and put the copied data into a few tabs that can be used to populate various charts on a dashboard tab. Each workbook containing raw data should go into its own separate tab within the active workbook. Broken into steps, I am thinking I need the below process to occur:
Open Active Book
Open hidden tab 'Sheet1'
Open raw data book 1(e.g. c:\Raw Data.xls)
Copy data from specified location (e.g. [Raw Data.xls]Sheet1!$A$3:$AE$64) in the raw data book 1
Paste copied data into Active Book, into specific worksheet, into first empty row (e.g. [Active Book.xls]Sheet1!first empty row)
Hide tab 'Sheet1' in Active Book
Close raw data book 1
Repeat process using raw data book 2 and sheet2 of Active Book
Repeat process using raw data book 3 and sheet3 of Active Book
Only after data is populated into the destination tabs (Sheet1, Sheet2, Sheet3 in the Active Book), can the user interact (click into cells, change tabs, etc) with the workbook
I know this is simple - I'm getting frustrated, as I'm a newbie and the syntax (and multiple variations of syntax) is really throwing me for a loop. Any help would be greatly appreciated. Many thanks in advance!!
Where are you getting stuck? Briefly:
Open Active Book
If its active, it's already open? Reference with object 'ThisWorkbook'
Open hidden tab 'Sheet1'
You don't need to unhide sheets to "VBA" them... If you're going to be creating new sheets for each datafile I'd recommend creating new via:
Set wsDestination = thisworkbook.sheets.add
wsDestination.visible = xlSheetHidden ' Might as well hide it now
If you're wanting to match specific raw data files with specific worksheets, maybe use a "select"
Open raw data book 1(e.g. c:\Raw Data.xls)
Set wbSource = Application.Workbooks.Open("c:\Raw Data.xls")
Set wsSource = wbSource.sheets(1)
'If need Select (see above):
Select case wbSource.name
Case "Raw Data A.xls" ' If line above changes to .Open(Workbooks[i]) or something
set wsDestination = sheet1
Case "Raw Data B.xls"
set wsDestination = sheet2
'...
End Select
Copy data from specified location (e.g. [Raw
Data.xls]Sheet1!$A$3:$AE$64) in the raw data book 1 Paste copied data
into Active Book, into specific worksheet, into first empty row (e.g.
[Active Book.xls]Sheet1!first empty row)
intBlankRow = Application.WorksheetFunction.Counta(wsDestination.columns(1)) + 1 ' Note this only works if there are no blanks in column 1 otherwise you'll need another method: there are some good tricks if you google "find last cell vba"
wsSource.cells.copy wsDestination.cells(intBlankRow,1) ' No need to copy and paste in seperate lines: you can just pass destination to the copy function
Hide tab 'Sheet1' in Active Book
You don't need to
Close raw data book 1
wbSource.close
Repeat process using raw data book 2 and sheet2 of Active Book Repeat
process using raw data book 3 and sheet3 of Active Book Only after
data is populated into the destination tabs (Sheet1, Sheet2, Sheet3 in
the Active Book), can the user interact (click into cells, change
tabs, etc) with the workbook
Wrap the whole thing in a big loop... If you wanna do it the easy way, create an array with your workbook names and iterate through it. Otherwise present the user with a FileDialogue so they can select the workbooks they want to import... this ofcourse depends on what I was saying above: do you want to create new worksheets each time or import specific raw data in to specific sheets...
I have 10 Excel files that each of them has 5 sheets. I want to have a One.xls file with 5 sheets contains all rows of that 10 excel files.
I found some softwares but none of them is free. I want to write it with Macro. how could I do it.
The best place to start is excelforum.com for specific answers but in short you need to lay it out into the following processes;
1) define the variable names for your one.xlsx workbook and sheet names so you can switch back
2) define the workbooks and associated file paths that you want to open
3) Open workbook 1
4) select the data
5) copy and paste into the master workbook
6) close workbook 1
7) repeat steps 3 - 6 for the other workbooks
that'll bring it into one consolidated list. Things to consider are whether you want to wipe what's in the spreadsheet already or add to the bottom so you may need a few error traps or cleansing tools to begin with.