I have input cells on a protected sheet with a tab order array setup. It was originally set up to work when their was a Worksheet Change. Not every cell is going to have data input into it. This is where the problem lies. If a cell is left blank it tabs out of sequence. I changed it to a Worksheet Open Sub but that didn't work.
I have forced the tab order of sheet. Unlike the example with the link, I have used named ranges instead of cell references in the array to order the tab sequence. (the named range are single cells and merged cells)
Force Tab Order Of Cells
Just like the author of the link, the sequencing works great but if I choose click on another cell (that is in the pre-determined sequence) it then takes me to the next pre-determined cell int he sequence.
I have tried the code the "shg" has suggested for merged cells to no avail. Maybe it has something to do with the name ranges.
Dim aTabOrd As Variant Dim iTab As Long Dim nTab As Long
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
I found the following code which works fine until I start to select multiple cells in cell B for deletion etc. At this point it throws up a run-time error 13 type mismatch, which will cause problems when other people start to use the spreadsheet.
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column <> 2 Then Exit Sub If Target.Offset(0, -1) = "" Then Target.Select Application.EnableEvents = False Target = "" Application.EnableEvents = True MsgBox ("You must enter Atlas Part No. first") End If End Sub
I have a VBA method that goes thru and calculates a bunch of stuff and puts this calculated info into a static data structure. This method is called 'setProjectInfo()'. This method is reliant on values on my worksheets, So as the user makes changes to the worksheet, I want setProjectInfo() to get called so it refreshes the data structure with updated information. I then have a bunch of helper methods to access different parts of this data structure. These helper methods are used in the formulae of a bunch of cells on a worksheet (ie '=getPercentComplete(period)', etc, etc).
This is all working well except for one thing. Sometimes the helper methods get called BEFORE setProjectInfo() gets called.. So, the helper methods return stale information. I can only get around this by manually recalculating the spreadsheet again. setProjectInfo() does enough stuff and takes a long enough time that I don't want to have to call it at the top of each helper method.
I've put the call to setProjectInfo() in a cell formula at the top of the my spreadsheet in hopes that Excel would know enough to call it first.. But that does not seem to work. Net, how can I get VBA to always call setProjectInfo() BEFORE it calls any other VBA methods?
I have a spreadsheet in which has many different cells that need to be completed if another cell has data.
Examples
If the user inputs a name into A3, they must complete cells B3 thru D3. Cells B3:D3 contain different entry methods including a drop down list.
On the same sheet, if the user chooses GTD from a drop down list in cell U3, cells BA:BJ must be completed. And if they choose GCI from the drop down list in U3, they must complete cells BK:BR
To ensure correct data entry, I need to ensure that the filled cells in a column are always in Uppercase for example, irrespective of whether they are typed in upper or lower case.
I have found the following code, which seems to work quite well, even though I have the impression that it slowed my workbook down slightly.
I am trying to force users to enter data in 5 separate cells in a worksheet. I have tried editing code I have found here, but just can't get it to work.
It is in the second sheet of the workbook and the sheet is called Invoice - the cells I want to force entry into (and the message I need) are as follows.
J2 - You must enter the salesperson's name J4 - You must enter the customers name J5 - You must enter the customer's address J6 - You must enter the customer's postcode L2 - You must enter the Invoice number
I have an interesting question for everybody here. Let me see how to best explain it.
I start in the code making sure column Action Plan completion has a value in it. Copying in the issue modified column if neccesary.
'Back fill last modified 'I need to start with the first data row (3) and the action plan completion column Let intcurrentrow = 3 Let intcurrentcol = intactionplancompletion Do Until intcurrentrow > intmaxrow If Cells(intcurrentrow, intcurrentcol).Value = "" Then Let Cells(intcurrentrow, intcurrentcol).Value = Cells(intcurrentrow, intissuemodified).Value 'Need to ensure that everything is formatted as a date Let Cells(intcurrentrow, intcurrentcol).NumberFormat = "m/d/yy h:mm AM/PM" End If Let intcurrentrow = intcurrentrow + 1 Loop
Later, I place this formula in a given cell.
=If(I9="Open-Remediated",M9-K9, If(I9="Closed-Remediated and Validated",M9-K9,"" ))
The info I copied above is placed into the column K.
When I run the macro, the cell formula outputs "#value".
However, if I go double-click then enter the cell calculates just fine.
I've tried excels overall recalculate function, but that doesn't change this.
Does anybody know how to simulate a double-click on a cell?
The tab order in an Excel spreadsheet is driving me nuts. I could not get it on my own and found some code that seemed to solve my initial problem. However, I still can not figure out why I can't go backwards. It will ONLY go forward no matter what you do. If you try to select a cell behind or in front, it just tabs to the next cell in the array. Can anyone help before end up sitting in the corner of the nut house crossed-eyed and drooling
I looked at threads realted to printing but wasn ot able to find something similar to what I need. So here is my problem:
I have a file with more than 100 worksheets (each sheet contains the invoice for one store). I would like to create a macro that would enable me to determine the order in which worksheets would be printed. How to do it?
Idea #1: the printing order would be based on the value in cell L1 that would contain the route number for each store. Stores belonging to the same delivery route will have the same value in L1. So, the macro should first print all sheets with 1 in cell L1, then print all sheets with 2 in cell L1 and so on...
Idea #2: Creating a separate data sheet with the list of all stores and their corresponding route number. Let's say info is contained in range A1:B150, where Column A contains the name of the stores and column B contains the route numbers. The macro then should look at that list to determine the printing order of the subsequent worksheets (the name of the store in column A would be the same as the name of the worksheet corresponding to that store).
Idea #3: sorting my 150 worksheets manually. It does not solve my problem fully, though, because stores do not always belong to the same route. So the manual sorting should be carried out daily and would not save time at all.
I have a list of terms to put together and what I have is a master list of 6 concatenate functions and I need to link them to all the different words in my list.
The first word in collumn A needs to be with the function in D1, the second word (A2) needs to be with D2, then A3 with D1, and A4 also with D1, while A5 with D6, etc. It looks something like this:
for your info...I have put numbers in the adjacent cell corresponding to which of the 6 concatenate functions need to go into the cell in collumn C
So in reality all I need is a function that would rearrange my list of 6 functions from Collumn D into collumn C based on the numbers 1-6 I have in collumn B
Workbook.txt
(attached is an example to better see what im talking about. Disregard that the concatenate functions are not working...it doesnt matter right now.)
I need a way to re-order an excel worksheets columns based on another worksheet.
Data is extracted from a database into excel however users can configure the columns in the initial system. to how they like This causes problems when the data is copied into an excel spreadsheet I have created as the data copied will not be in the same column order as is required.
How can i reorder the columns without physically having to cut and paste the columns to match?
I have attached a sample spreadsheet.
You will see on the spreadsheet that 'fixed columns' is the order that i require the data however 'variable columns' is not in the same order.
As you can see, the second column contains abstracts which I want to use to determine categories for each document (each line).
Categories are as followed : Diabetes prevention -> keywords : sugar, diabet*, insulin* Obesity prevention -> keywords : weight-loss, fat*, LDL etc. (5-8 categories)
To target one keyword, I found this formula : =IF(IFERROR(SEARCH("*diabet*"; $B3); 0); "Diabetes prevention"; " ")
What I would like to know is how to add more than one keywords in this formula.
I would also like to know, if it is even possible, how to put every categories in this column, so that i don't have a category per column ... It's hard to explain.
I want to have in front of each line the corresponding column. It means that the formula has to search for every keywords and select one or more appropriate categories.
Excel 2007. At the bottom of a column of data I'm trying to reference the cell $AG4. There are 340 total columns. Each additional column to the right needs to reference the next cell in column AG. So I'm trying to drag and copy horizontally from $AG4 to $AG340. When I try just the single column it just copies $AG4 into everything to the right. When I have to columns ($AG4 and $AG5) and grab both to try to copy horizontally the numbers increasing it just does $AG4, $AG5, $AG4, $AG5, etc.
Have developed a form for my associates and want them to be able to move to the cellls I want them to fill data in to by merely hitting the TAB or ENTER key vs. having to move the cursor to each cell requiring them to input data.
Want cursor to move in a specific cell order. You would think you could merely say 1M, 2C, etc.
In Excel 2007, Windows 7 Home Premium, I am trying to summarise multiple worksheets into one sheet, creating a list in one column in this summary sheet that includes the cell contents from the same cell from each sheet. For example, my first sheet is called KCD183 and I want to list the value from KCD183 Cell A2 in my Summary Cell A2, then show KCD184 Cell A2 in Summary Cell A3 (i.e. the next row down). So my Summary sheet will list all cell A2s from all my sheets, 1 after the other down column A and will continue to add these for any new sheets I add.
I realise that I could just export the spreadsheet to Access and report on it from there, but I don't have the software!
I am looping through each cell in a range and I would like to loop in reverse order.
Dim CELL As range Dim TotalRows As Long TotalRows = Cells(Rows.Count, 1).End(xlUp).Row For Each CELL In Range("C1", "C" & TotalRows) CELL.Select 'Code here to delete a row based on criteria Next
I have tried:
For Each CELL In Range("C" & TotalRows, "C1")
and it does not make a difference. I need to loop in reverse order since what I am doing in the loop is deleting a row. I am looking at a cell and determining its value. If the value is so much, then the row gets deleted. The problem is that the next row "moves up" one row (taking the pervious cell's address) and therefore the For Each Next loop thinks it has already looked at that row.
Is it possible to trigger a forced comment if a particular value is entered in a cell?
For instance, if the letter "F" is entered into a cell, I want the comment box is pop up, is this possible?
And lastly... is it possible to automatically group comments? for instance if a row has 6 comments, I'd like to combine all of them into a comment box on the same row.
My spreadsheet is very large & takes sometimes 5 to 10 seconds to recalculate. The problem is that is was wanting to recalc every time I edited a cell, which I do constantly all day long. Due to this, I have turned off automatic recalculation. Is there is a way I can use VBA to force just one cell or just one row to recalculate? Keep in mind that currently no cells recalculate until I hit F9 or go in & manually hit Calculate Sheet in tools > options > calculation.
I've looked through the threads and have seen some Save As posts, but nothing that seems to fit my task. All I want to do is force the Save As file type to .xls (for some reason on our network, xlsm causes save errors... After looking through various posts, I found this:
VB: Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) If Not SaveAsUI Then Exit Sub [code]....
The problem is this causes the Save As dialog box to show up twice... How I get the Save As dialog box to show up once?
I'm looking for a way to take a number (23.89145 or $3.45 for instance) and use a formula to force it to end in a 4 at two decimal places (23.84 or $3.44)...generally only interested in going down.
Is there any way to force some sort of garbage collect in order to free up memory? I am running some code which takes values from one workbook and pastes them into the control workbook. It currently works when 15 sheets of data are being moved however, my data has just grown to 16 sheets and now the code gives me the not enough resources message. If a garbage collect would solve this issue would I need to also reset any variables I had defined in the code?
I have an Excel sheet which serves as an input form. I would like to set something up where if the user inputs any value into the cell range B12:B100 then they are forced to also enter a value in column J of that same row.
Maybe something could be done where if they enter a value in B12, then they cannot enter a value in B13 before entering a value in cell J12?
I have created a tool in excel to facilitate different requests from our sales force. A drop down list in the first worksheet lists the request types. Once the type is selected the user clicks a command button that sends the user to the corresponding worksheet specific to the request type.
My problem is that I need to verify that the cells on the specific worksheet have all been completed. I tried to verify when saving in the workbook module, but I don't know how to only check the selected request worksheet.
One thought was to insert save command buttons on each worksheet and only allow saving through those buttons. (So I would need to remove any saving functionality from the file menu/toolbar.) Then I could attach the verification code to that button on each worksheet. Preventing saving until the requested data was entered.
If this methodology will work I need to know how to do the following:
1) remove alternative saving methods
2) Once those methods are removed, how do I code a command button to check that specific cells are not null and then "save as".
3) if cells are null then, stop save and show msgbox.