Change Generated WorkSheets Name And Formats?
May 3, 2014
I have a file here that already has macros in it. The file is basically a excel document generator. When you click create sku, the document will generate multiple documents based on the user inputs.
1) In the generated documents the original "generator" file creates, I need generated files to have column B and D formatted to TEXT, currently all the generated files are formatted to general. (This code is in module 1, line 84 col 34.)
2) The other problem is I need to append the value in Cell N1 in the "sku data entry" sheet to be appended to the generated file names. (this part of the code is is in module 1, line 150 col 28.)
I was unable to attach my file to this thread because it was to big. however I copied the module where I think the code is causing problems:
Sub procData()
' Starting point for read/extract process
Cells(4, 6).Select ' Range = F4 (row 4, col 6)
For x = 6 To 52 Step 2 ' col F to col AZ
[Code]...
View 1 Replies
ADVERTISEMENT
May 2, 2014
I have a file here that already has macros in it. The file is basically a excel document generator.
When you click create sku, the document will generate multiple documents based on the user inputs.
Two things in this file
1) In the generated documents the original "generator" file creates, I need generated files to have column B and D formatted to TEXT, currently all the generated files are formatted to general. (This code is in module 1, line 84 col 34.)
2) The other problem is I need to append the value in Cell N1 in the "sku data entry" sheet to be appended to the generated file names. (this part of the code is is in module 1, line 150 col 28.)
View 1 Replies
View Related
Nov 22, 2013
I have this code as seen below that sends an email.
I would like to change the font size of - mymail.body=
How can I modify this existing code to achieve that.
Code:
Set myOlApp = CreateObject("Outlook.Application")
Set mymail = myOlApp.CreateItem(olMailItem)
mymail.Subject = strSubject
mymail.Body = "WHAT DO YOU PUT INTO A BOX ?"
mymail.Display
mymail.ReadReceiptRequested = False
mymail.attachments.Add "P:SR.xls"
mymail.to = "email@email.com"
mymail.Send
View 4 Replies
View Related
Nov 25, 2011
I have a workbook with worksheets that are named in various ways that I need a VBA macro to sort.
Some sheets have names that begin with numbers.
I am able to get the macro to sort them all alphabetically but those with numbers are always put at the start of the work book instead of within the alphabetical format I want to use
I may have sheet names like:
CAT 3CAT 1CAT 2CAT MONKEY DOG 4DOG 3DOG
This is how I want these sheets sorted:
CAT 1CAT 2CAT 3CAT DOG 3DOG 4DOG MONKEY
The sheet names are examples and not actual sheet names.
Below is my code so far
Code:
For lCount = 1 To lShtLast
For lCount2 = lCount To lShtLast And Not IsNumeric(Mid(UCase(Sheets(lCount).Name), 1, 1))
If UCase(Sheets(lCount2).Name) < UCase(Sheets(lCount).Name) Then
[Code].....
View 2 Replies
View Related
Jul 27, 2006
I did this macro which formats five worksheets in the same file. I saved this macro as a PERSONAL.XLS file. Last night when i open new files to re-run this macro it was working fine excep one of the worksheets wasnt formatting properly....the macro on this sheet wasnt working for some reason.
Then this morning when i opened new files and tried the macros again it wouldnt work at all. And there is no reacord of them I did five of them and they are all gone! I saved them so why did they disappear! I thought that when you saved a macro as a PERSONAL file that you could open new files and re-run that macro again and again????
View 9 Replies
View Related
May 3, 2007
- I have a worksheet (W1) which i have filters
- I have another worksheet (W2) that is formatted for a institutional purpose where i must put the things selected in the W1, but the problem is that: in the W1 i have a cell (A1) with some data but in W2 i have a space composed with one line but with several columns and excel says that he cannot paste the information copied in W1 to put in W2.
there is any way to avoid this problem because at the moment i am making copy paste one by one, and it takes to many time and i would like to copy and paste the information selected by the filter in W1 to paste in W2.
View 9 Replies
View Related
Aug 2, 2006
I am attempting to copy some numbers from one spreadsheet to another including the formats. The format I am using is a user-defined one which doesn't normally appear in the list of personalised formats.
My code seems to work fine within the same spreadsheet but fails when I do it using 2 spreadsheets.
View 9 Replies
View Related
May 28, 2009
I have a userform which allows data to be entered onto a worksheet. One of the fields (a textbox with the standard calendar control) is the date. When the transaction saves, it correctly saves the date as dd/mm/yyyy using
ActiveCell.Value = TxtDate.Text
I also have a form which allows the user to amend a transaction by loading the data onto the form, amend it and save it back to the worksheet.
The problem is that when it picks up the data and re-saves it, it's resaved in the format mm/dd/yyyy which is a problem because I use the month as one of the categories that users can filter the data by.
I also have the following line immediately after each time the data is saved from the form to the worksheet:
Selection.NumberFormat = "dd/mm/yyyy;@"
View 7 Replies
View Related
May 9, 2008
I am importing data (using filestream) from txt files with comma delimited values. When I import dates into General type cells it turns a date of dd/mm/yyyy into mm/dd/yyyy only if the date makes sense.
I would like it to import dd/mm/yyyy as dd/mm/yyyy.
I am also interested to know how Excel/VBA deals with dates coming from various sources, what quirks or mode of thought it follows.
View 9 Replies
View Related
Dec 11, 2013
I have a hidden worksheet (in my add-in) where I store various configuration options for my processing. Among these are some cell formats that I apply to a target worksheet for the user to reformat their sheet.
I want to give the user the option to change some of these formats (font name, size, color, interior color). Is there a way to use a userform textbox to let the user format the text and fill options, or how would you recommend I do this?
I want to be able to store these options in my hidden config sheet so they can be applied every time, but do not want to unprotect the user worksheet for them to make the changes there.
View 1 Replies
View Related
Oct 24, 2013
Have a simple Pivot table that i have grouped in 14 day buckets.
Currently, the date range looks like this:
1/21/2013 - 2/3/2013
However, I want the range to show the 'last' date only.
Is there a simple way to do this? I just can not see it in the format cells menu...
Gary Pivot.jpg
View 1 Replies
View Related
Jun 4, 2014
I receive sales data from my wholesalers every month and I continually have to format them to fit the structure of our in-house database. I wanted to design a macro that would automate this process. However, in some months, the files are recieved in a format that is a bit different from the wholesaler's usual format.
Is there such thing as an initial "litmus" test where I could try running the macro and if it doesn't fit the usual structure, there's an error code and I could do it by hand?
View 3 Replies
View Related
Sep 30, 2007
I have a spreadsheet that is very large and formated a certain way. I want to make sure that a user cant put the cursor in the lower left corner and copy cells by dragging, copy & paste, or do anything other than input data and be able to highleght text and reinput data in case they mistyped or misspelled the data.
ex: user clicks on cell E33 and types in '1234568' and then move to next cell. The user can click back on E33 and can correct by retyping. That is all the user is allowed.
The cells in question are also in ranges if this helps. EX: 'E33:AJ67'
View 9 Replies
View Related
Jul 28, 2012
In the toolbar there's a section titled "Number" which allows you to change cell formats with selections named General, Number, Accounting, Date, Time, etc. I want to permanently change some of their default formats.
For instance, currently when I select Number the default is -4000.00. I want to PERMANENTLY change its default to (4,000.00). How do I do this?
View 3 Replies
View Related
Aug 2, 2006
I need to change the color of that part of the excel that shows the name of the worksheet(the location where it's writeen "Plan 1"[I don't know what's the name in english]). How can I do that?
View 8 Replies
View Related
Dec 5, 2011
I have a work book. The sheets are for different months. I also have a summary pages that calculates and number of things. How I get the summary page to look at a different work sheet without changing to many things.
OctAlice KwokCandy LeeStudents Served %77%
(=Oct!C2)0% (=Oct!D2)PM Satisfaction3.66 (=Oct!C3)2.67 (=Oct!D3)14 Day KPI85%85%
Current the formula points direcrt the the worksheet =Oct!C2
I would like to be able to change a cell that matched worksheet names and the summary automatically looks at that work sheet.
View 3 Replies
View Related
Feb 18, 2012
I have a folder in Dropbox (important that it is stored there, it is shared with 15 people who are on a bunch of different networks) that contains 15 spreadsheets. One of them is the master, containing performance data for 14 people. The other 14 are for each individual person pulling their performance data from the master. Monthly, the master spreadsheet gets updated, and I want the user spreadsheets to update, so I can email the individual spreadsheets to each person so they can track their performance. Of course, they cannot see each others numbers, so they have no access to the folder. There are a handful of people that have access to the master. All the spreadsheets will live in this folder all the time.
The issue is that on my computer the path to the master is different then it is for other users because of where Dropbox stores local data by default, and for a lot of reasons, I cannot change it.
Is there any way to tell excel that the master (or the other 14) live in the same folder so there is no need for the first part of the path?
View 6 Replies
View Related
May 24, 2006
I am trying to create a program to automate the gauging figures on oil barges, currently everything is done by hand and takes approximately 20 minutes to complete. I have the charts entered for the tanks already and have the code set so that when you click on a tank "gauge" it will enter the "volume" which corresponds to that gauge on a totals sheet. Here is where my problem is coming in
The barges are gauged at four points
"before loading"
"after loading"
"before discharge"
"after discharge"
I want to set a worksheet as the default page with four command buttons that let the user select which operation he wants to perform. before load figures. after load figures and depending on which operation they select have it enter the volumes in the appropriate cells on the totals sheet. So if someone selects "loadopen" command button I want the following code to run on my worksheets............................
View 2 Replies
View Related
Aug 29, 2006
I am trying to make a macro run automatically based on info entered in a cell. The problem is I need this code on at least three separate sheets in the work book. It doesent work when I try to use the same basic code. The code I am using is below.
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim lLastRow As Long
Dim rgArea As Range, rgCell As Range
Dim COL_B As Integer
COL_B = 2
Dim COL_X As Integer
COL_X = 24
Dim ROW_FIRST As Long
ROW_FIRST = 5
' Find the last row of date in the "Approved" worksheet
lLastRow = FindLastRow(SZ_WS_APPROVED, COL_B)
' Set a reference to the changed cells in column X
Set Target = Intersect(Target, Range(Cells(ROW_FIRST, COL_X), Cells(lLastRow, COL_X))).........................
View 5 Replies
View Related
Nov 21, 2011
I have a workbook with 33 worksheets (31 date tabs and a Month To Date and Year To Date tab)
I want to have a clickable cell on each of the 1-31 date tabs to point to the MTD
I know I could do this easily with a hyperlink but I would rather have a clickable cell.
I have achieved this on an individual worksheet using the following code
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Not Intersect(Target, Range("$R$3")) Is Nothing Then Sheets("MTD").Select
End Sub
My question is: Do I have to copy this to every single worksheets code or is there some way have all sheets read the same private sub? (I guess it negates the point of a "private sub")
Way to do this as it would make editing any changes easier than having to do it 31 times.
View 3 Replies
View Related
Sep 26, 2012
I need to compare 2 worksheets, one containing a list of IP adresses that need to be checked (interfaces), and another containing a list of IP addresses that have been checked (Scanned hosts), there are over 100000 scanned host entries.
I need to search the "Scanned hosts" worksheet to ensure that all of the IP addresses listed in the "Interfaces" worksheet have been scanned. I then need to place an entry next to the IP address on the "interfaces" worksheet to indicate the check date and the name of the person who checked it. It also needs to change the colour of the cells to indicate if it has been found or not found.
The code I have written so far (from piecing together different threads from MrExcel), at first glance, seems to work perfectly. However, if I replace an ip address in the "interfaces" worksheet, with one that I know does not exist - it still marks it as found.
Interfaces;
IP Address
System
Date Checked
Checked By
1.2.3.4
fred bloggs
1.2.3.5
fred bloggs
[Code] .....
Scanned hosts is just a list of IP addresses and text (168000 rows) in a single column. Format is xx.xx.xx.xx ^IP^^^^Jul 29 2012 08:01:29:000PM
Sub Compare()
Dim X As Long, CurrentRow As Long, FindRow As Long, WS1 As Worksheet, WS2 As Worksheet
Set WS1 = Worksheets("Interfaces")
Set WS2 = Worksheets("Scanned Hosts")
CurrentRow = 1
[Code] .....
View 4 Replies
View Related
Jan 18, 2009
I’m creating a spreadsheet to control corrective actions. Each corrective action will have a date that it needs to be completed by. When the completion date plus one day is passed, I need the cell that the completion date is in, to turn a specific colour and a warning mail to be sent via outlook When a further six days have passed I need the cell to turn a different colour again and another email is sent
Ive generated the following code to call an Outlook subroutine if the correct conditions are met. The subroutine runs ok but I can get the sheet code to run.
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Range("A1"), Target) Is Nothing Then
If IsDate(Target.Value) And Now() = Target.Value + 1 Then
Target.Interior.ColorIndex = 3
Call Mail_with_outlook
ElseIf IsDate(Target.Value) And Now() = Target.Value + 6 Then
Target.Interior.ColorIndex = 5
Call Mail_with_outlook
End If
End If
End Sub
View 9 Replies
View Related
May 30, 2008
I have a workbook with approximately 30 worksheets. This workbook already has a massive macro that I've written. I'd like to write a code that will take a designated worksheet, check to see if there is data in cell A2, if so, save it as a new workbook.
The name of the workbook should be predetermined, for example "SIA April(Previous Month) 2008(Current Year) P-Card Import Template.xls"
The months and years will need to change.
The file to save it in will also change monthly- for example- G:PCard DirectoryCloses2008 ClosesApril(previous month) 2008(current year)
View 9 Replies
View Related
Feb 7, 2014
I'm trying to sort some data that is generated from a PDF. When I copy the PDF into Excel all of the data is placed into one cell. Is there a function or formula I can use in VBA or within the spreadsheet to accomplish this?
For example, the cell may contain "Employee John Employee Steve Employee Dave Employee Jed Employee Mark" in cell A1. I want the function to list John, Steve, Dave, Jed and Mark in separate cells. So I need to get rid of the space bar hits, the word employee and to separate the names to different cells.
A1 currently is "Employee John Employee Steve Employee Dave Employee Jed Employee Mark"
I would like to create a formula to have cells:
A2 = John
A3 = Steve
A4 = Dave
A5 = Jed
A6 = Mark
View 3 Replies
View Related
Aug 30, 2007
I wish to create a new sheet/workbook which promts the user to enter a start number and an end number. I want to then display 20% of randomly picked numbers between the start and end figures.
For example, the user enters 1 as a start and 20 as an end figure. 20% of this is 4, hence I want the system to randomly return 4 numbers between 1 and 20.
View 9 Replies
View Related
Jul 11, 2006
I have the following code that will look through an individual worksheet, if the value in column D is equal to 5 and the value in cells E6:L1000 is "a" then it should generate an email. The problem I am having is that it generates 8 emails, one for each column. What did I do wrong in the code? It should only generate one email for the cell which has the "a"
Sub Test()
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Dim cell As Range
Dim wsWH As Worksheet
Dim lngMax As Long
Dim intFiveDays As Integer
Application. ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
On Error Goto cleanup
Set wsWH = Worksheets("WH")
lngMax = wsWH.Range("A65536").End(xlUp).Row
For intFiveDays = 6 To lngMax...................
View 7 Replies
View Related
Dec 6, 2006
We are having a sporadic issue throughout our company where when users attempt to open an ASP generated spreadsheet in Internet Explorer and then hit CTRL+A to copy all contents and attempt to paste into a regular Excel-launched spreadsheet (i.e. launching Excel independent of IE), the last two columns are not being copied. Further, when attempting to just copy the two columns, themselves, only the first is copied, and when attempting to copy one cell each in the two columns (that are in the same row), only the first cell is copied. Additionally, when examining the clipboard in this instance, only the first cell is being copied to the clipboard, so for some reason attempting to copy it out of the Excel spreadsheet that opens in IE is when the issue occurs (vs. having the issue occur when you are trying to copy into the new Excel spreadsheet from the clipboard).
View 6 Replies
View Related
Aug 14, 2007
I am have some code that takes values from a range (sourceAll) defined on my worksheet as:
Set sourceAll = Workbooks(pathnm).Worksheets(m).Range("A1", "S34")
I'd now like to be able for the range to be generated dynamicaly, but my problem is that the far right column (S) does not always have a value for every entry. Is there a way of using a column that does have a value for every entry, say column B, but then extending the range accross to S? If possible I'd like to avaoid having to move one of the columns with values for every entry. Auto Merged Post;I was looking at some of the suggested threads and found some code that I worked into my own
Set countRow = Workbooks(pathnm).Worksheets(m).Range("B1250").End(xlUp)
Set sourceAll = Workbooks(pathnm).Worksheets(m).Range("A1", countRow)
sourceAll = sourceAll.Resize(sourceAll.Rows.Count, sourceAll.Columns.Count + 17)
now this seems to work mostly, but it has deleted everything that was in column B.
View 2 Replies
View Related
Sep 29, 2012
I am making custom time sheets to suit our agriculture business - these excel sheets get sent out to the different farm managers who send back in staff times.
This code below is brilliant and works perfect for our needs. However I need to be able to emailPDF the sheets not print.How / where do I change code so the selected sheets go to Save & Send via email as a PDF instead of going straight to the default printer .( hard copy )
VB:
Option Explicit
Sub SelectSheets()
Dim i As Integer
Dim TopPos As Integer
Dim SheetCount As Integer
Dim PrintDlg As DialogSheet
[Code] .....
View 5 Replies
View Related
Aug 7, 2008
I have a schedule sheet (on week days what assignment is be to taken in concerned period).
I need a report based on the same. i.e. I need to generate a report for each individual.
I have attached a sample file, in which I explained the requirements.
View 12 Replies
View Related