What do I need to add to this script in order to stop the macro after the last cell with data. Currently it will continue to add and additional sheet and then error out b/c the next cell is blank and it doesn't know what to enter as the worksheet's name.
For Each c In Sheets("Sheet1").Range("A1:A24")
Sheets.Add
ActiveSheet.Name = Right(c.Value, 30)
Next c
I have created a worksheet with different validation rules for different columns for users to enter data. Is there a way I can make it so each cell must be filled in? I don't want any blank cells. Is it possible to create some so that the user must fill in the cell before moving on to the next cell.
I've looked through the threads and while I have used Data Validation to stop duplicate entries, I want to also make certain that those entries are only Dates. In other words, if Cells A1:A10 are to contain unique dates, I use Data Validation with the Custom condition below; = COUNTIF($A$1:$A$10,A1)=1
If the user enters the same date more than once, an error message pops up. However, the user is not prevented from entering a range of dates in a cell such as "July 5-7". How can I validate that the date is entered only once AND the entry is a valid Date. With Data Validation it seems I can specify to allow a DATE with specific criteria, or the Custom, but I can't see how I can do both.
but i need to have it split in to individual cells so
Cell A1 would be 101 hampton court B2 Hampton Heath C2 Hampton Town D3 Hamptonshire E5 HA01 1AS
each part of the address is split by a comma, so i have tried to use that as a identifier as to where that part of the address is, but failed on that, i can separate out the first part and the post code with a find and replace but not the middle.
also i need it to work backwards ie
it finds the post code first,
then the county
then the town
as those 3 are always the last 3 parts, but the address could only have 1 line of addres beofre the town or 3, and it would get messed up as all the post codes, county ans town needs to be in their respective columns
my excel sheet runs through a lot of calculations, opens Flowmaster, a simulations program, passes on data, receivs data and so on. Is there any way to have a user input to stop the whole simulation. During the first tries I had a lot of break point in my debugger. But now I want to have a button to hit or better just some keys to hit to stop it without using the ctrl+alt+del which closes everything.
I am having a sheet where I keep track of when online surveys have been sent to users. The users enail address (column K) may be on the list for several times, but I need to make sure that there is at least a 7 days pause between sending the first mail and the second, depending on the visit date (column G).If there are less than 7 days between two entries with the same email address, the user is not qualified for taking another survey.
I was thinking to write an IF formula which returns either 1 or 0 and then let conditional formatting highlight and HIDE the row via a VBA loop.
Is there a formula that will allow me to look for the existence of any number value in a row of one worksheet and then return a specific number value in a cell on another worksheet? For example, if the formula finds any number value it will always return the number 15 to a cell on another worksheet.
I used a form with textboxes for data input for one of my vb macros. Currently I have the private sub from the form transfer those entries to a remote cell on the spreadsheet, (like in column "HZ"), so that the macro that will actually utilize them can retrieve them. Is there a way to pass that data directly from what is entered in the form in the textboxes to the macro that will actually use them?
The code down below counts all cells from column A2 to I11. The problem; the code should stop counting if there is a blanc cell in a column and go to the next column to countinue. My query; how should the code be modified so it will stop counting if there is a blanc cell.
Sub del() Dim myRange As Range Set myRange = Range("AK3:AL3" & Range("AL" & Rows.Count).End(xlUp).Row) For i = 1 To myRange.Rows.Count If myRange(i, 1) >= myRange(i, 2) Then myRange(i, 1) = "" myRange(i, 2) = "" End If Next i End Sub
How do I add a condition that will stop the macro if myRange = ""/is empty?
I seem to be lost in some macro-coding... I have this folder with pictures, and I want to display them as comments, by a macro. So far I have control. But then, if there is a picture that is missing, or if there is a cell that is empty in the selection, everything seems to stop.
the macro I use is very simple, but when everything is in place, its working:
Sub pics() For i = 3 To 50 PicName = "C:UsersEspenPicturesHus" & Cells(i, 1) & ".jpg" With Cells(i, 1).AddComment .Shape.Fill.UserPicture PicName .Shape.Height = 300 .Shape.Width = 400 End With Next i End Sub
Is it possible to make the macro run even if there are wholes, or if some pics are not store in the folder yet?
Is it possible to make the area "unlimited", as you see its now limited from 3 To 50.
And is it possible to make this run automatically, kind of checking the folder on its own to see if there is new pics?
I have a cell with data validation: list, that allows values contained in named range. I want to disallow to delete contents of this cell (with 'del' key, or when i edit cell, delete text and then press 'Enter'). Is it possible to do with formula or VBA
is there any way to hide the comment box associated with with red triangle in the cell.when mouse is on the cell having comment (red triangle) the yellow colour box should not appear.
I have a cell that has a formula in it and is also Excel Dates & Times coded. Hence when the repsective cells are empty and there is no values to be calculated the date "00-jan-00" shows. how to prevent this from showing up allowing for a blank cell to only show?
the following macro works great if there is data below cell O4. but is there isn't any (e.g., at the beginning), then the cursor runs down to 65,536. ?if no data exists, how can i stop at cell O5...
I have a sheet that I fill out with customer data then print and start over with the next customer. This requires me to tab and delete through the sheet before starting the next entry and I am wondering if there is some way to auto clear the unlocked cells based on a single entry IE when we entered new data in the 1st field this would clear the unlocked cells and make them ready for new data?
i have managed to pull together some code that will deny people adding data into cells if they have 5 of the same entry. the entries are entered in a range and are matched against a single cell outside of the range. heres the
Private Sub Worksheet_Change(ByVal Target As Excel.Range) Dim greycell As Range, i As Long If Not Intersect(Target, Me.[grey]) Is Nothing Then Application.EnableEvents = False For Each greycell In Target If WorksheetFunction. CountIf(Me.[grey], greycell.Value) > 5 Then i = greycell.Interior.ColorIndex greycell.Interior.ColorIndex = 3 'red greycell.Select MsgBox "no cell entry past 5", vbCritical, "ERROR" greycell.ClearContents: greycell.Interior.ColorIndex = i End If Next Application.EnableEvents = True End If End Sub
what i need with is adapting this code to match two ranges as i cant use the worksheet_change event twice. i need it to be as if they were seperate events but are merged together. eg:.............
I am trying to do with data validation, trying to stay away from vba on this... and it is probably very simple:
Cell A1, they can select Rice, Cheese, or Rabbit I want to use custom data validation on B1, so that if A1 = Rabbit, they can only enter 1. If it is blank or the other two choices, they can enter 1 through 10.
Can I do that with data validation? I can't get any if thens to work in it.
I need to copy and paste data from the internet into Sheet 2, but it's not in the correct order, so I must swap column A and column B in Sheet 2 only. The problem with this is that when I swap them, the linked cells swap as well, which destroys my data on Sheet 1 columns C-Z.
Is there a way that I can keep the cells on Sheet 1 completely static, so that it only reads the data I put into the corresponding cell on Sheet 2?
Or maybe, is there a way I can just swap the cell information in Sheet 2 without messing around with the formatting? Just a complete swap of A1>B1 and B1>A1?
I have this sheet full of random data and I want to recalculate extra fast so I keep my finger on F9 which causes the random data to randomize really fast of course. Now, in B1:AT1 I have numbers that change with every recalculation but here is the problem. I want the recalculation to stop when excel identifies a zero in that range which doesn't happen often.
the code below works fine except for the fact that it takes FOREVER to complete as it has to loop through almost 2000 rows... How to optimize this code so the macro stops as soon as it encounters an empty cell? There is currently only 50 entries in the database, but with time it will exceed 1000 entries and therefore i can't simply say Range("H2:H50").
Code: If OptionButton1.Value = True Then 'Show all Car Cases Sheets("User-defined Database").Activate For Each cell In Range("H2:H2000")
Trying to use VBA to prevent users from sending a form unless all fields have been completed, then highlight blank cells, and send a pop-up message that all cells in myRange need to be filled out. Otherwise, send the worksheet.
My code will highlight the blank cells, but it only highlights one cell at a time and then I have to click on the pop-up message for it to highlight the next one, and then the email still goes out.
How can I fix this to highlight all the blank cells at once, with only one pop-up message, and prevent the email from going out?
Public bCheck As Boolean Sub SendWorkSheet() . . . . 'HIGHLIGHT BLANK CELLS
i run a Excel spreadsheet that adds payments that are made, and i have a row put there so i can make notes. sometimes these notes are quite long and if the cell to the left of it is empty the text will continue going across these cells and make my spreadsheet a real mess to understand. how do i make text stay only in it's given cell?
When users enter data, I want them to enter a percentage into column D OR a dollar amount into column E, or enter nothing at all, but NEVER to enter into both D and E on the same row. They are set to zero by default.
It would be great if a message box could just pop up saying they can do one or the other, and if they've already entered into the other cell they need to zero it out before changing this cell.
I have referenced data in two colums on a sheet A and B. Column A contains the latest data, each month i insert new column (moving column A to column B). However all of my references continue to follow the original data (eg will change from column A to column B). this happens despite using Absolute references. (=$A$1). Is there a way to lock these cell references to only ever display column A etc?
Right, sorry this is probably a simple one but I can't do it... I have information in a variable that is "1-4" the variable is defined as a String but whenever I use the following code excel turns it into a date.