Question and Answer

For Excel / VBA questions - You ask, Excel Experts will answer

VBA Macro Copy to next empty row, different sheet

Hey guys, so I made a macro to copy data from my data entry sheet to my database sheet:

VB:

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Private Sub CommandButton1_Click()

Application.ScreenUpdating = False

Sheet2.Range("d3,d5,d7,d9,d11,d13,d15,d17,d19,d21,d23,d25,d27,d29,d33,d35").Copy

'copy to next page
Sheets("September").Select
Selection.PasteSpecial (xlValues), Transpose:=True

Question

1 - How to lock a cell in Excel 2007?
Can I just lock myself in a sheet.
2 - The key for me to return to the previous sheet.
3. Hide and reveal columns

Output Excel to Text

According to attachment
It can be done with a macro?

Please help I need a macro that will do the following
In sheet 1 I enter the input data
The first column of
The second column is the account number (10 digits)
The third column (sum)
I want to exit from Excel
Text file
First Line
After the first 10 digits of 15 digit amount.
0000000001000000000200000

Second line
10 digit account number
Next figure of $ 15
134256010000000005264210

Email one sheet from a workbook through outlook

I have attached a version of my file with code that I have adjusted. Everything is working except for the save as portion of it. I keep getting a run time error 1004. The save as of the workbook failed. Also, when I run the macro in the template that I have uploaded it opens up the original file that I had the code in. Any help is appreciated.

Excel 2010 to OutLook 2010 Meeting Request Problems

Hello Everyone
I have managed to get the code below to work but I have some issues:
When I run this code I get the following in the Meeting request:

Issues:
• Instead of the true content for line 6 it chooses date Fri 29/12/1899
• Instead of the true content for line 7 it chooses date Sat 30/12/1899
• I am trying get the code to choose the all day event IN Line 8
• In the Body [Line 9] it simply adds the word “True” instead of actual content
• In the Subject [Line 16] it simply adds the word “True” instead of actual content
Any help with this would be very gratefully received

can i set excel to automatically copy and edit data?

Hello there,
I am trying to make this logbook
I have in column A flight date, column B aircraft number
Column C defines whether the pilot (whose name is the title of the sheet) was the pilot in command or the second in command
And column D defines the other crewmember (which can be pilot in command or the second in command)
Here is what I want to do:

Forms Checkboxes

I'am trying to sort Checkbox but can't manage to do it using VBA.

What I have done so far is the following:

- Add checkboxes using VBA to span a cell [CODE] ActiveSheet.CheckBoxes.Add(MyLeft, MyTop, MyWidth, MyHeight).Select
- Select a range in a sheet and by using Sort and Filter button - Custom sort then default options ( A column - By value - From A to Z)
- A Macro has been set for each checkbox

This way the column in which I have the Checkboxes are sorted correctly.

My problem is that using VBA to sort the range using Macro Recorder does not sort my checkboxes.

IF(ISERROR)

Hi All,

Trying to figure out how to use IF(ISERROR) function with the following formula.

IF(C57=$C$14,VLOOKUP(C57,'Travel Reference'!$A$1:$B$42,2,FALSE)*(B57+1),VLOOKUP(C57,'Travel Reference'!$A$3:$B$42,2,0))

Checking limit values from separate xls file

Hello to all experts on the forum!

I am looking for some kind of elegant solution for my Excel form. Let me describe in short the problem I am trying to solve.

At work I order different types of furniture (windows, doors, etc) and also all types of shades that go with different type of furniture. Since there are lots of different providers of the shades, there are also different limitations for each and every manufacturer. It has gotten to the point I cannot keep up with all the different requirements and limitations.

Importing Text into Excel - How to increase 8192 character limit per cell

I'm using VB to import text files into an Excel spreadsheet. 

VB as provided on this thread http://excelexperts.com/comment/reply/1611/2671 works great for that.

Some of the files are quite large - but I need them to go into a single cell.

However some of the text data is getting cutoff because of the 8192 character limit.

Is there anyway to edit something to increase the character limit per cell?

Formula updates once and then ignores changes to reference cell.

I have two formulas reference each other for one function: A user can input data into one cell and have it converted into a different form of currency in the other cell, and vice versa. The conversion is done by taking the input, referencing a coefficient and either dividing or multiplying by it. The problem that lies within this, is that one currency inflates in value very quickly either up or down, so the referenced coefficient changes from day to day.

Copy from immediate window to spreadsheet

Help!

Print multiple worksheets/slicers

I have an Excel worksheet with about 150 different slicers (Account Names) that are used to filter account data. I want to know if there is an easy way in Excel 2010 to print the data for each of the 150 slicers without having to load each individually and manually print.

Third dimension problem

Hello, well recently I have been working with my grandfather whom was an engineer. We want to try to use the excel vba as a way to plot 2-5 dimension we have got the 2 dimensions working by exporting the data to a spreadsheet with the activeCell(x, y) = a command. Is there any certain command line that would allow us to get three independent variables to show up on the spreadsheet? Btw we are using this as a scientific approach not business wise. Help would be very fortunate right now, thanks!

MSA 4th Cross Tabulation Excel Format

Hi im developing, a Cross-tabulation format, which works very well; it does Kappa calculations but in the part of the data entry there is the: Data, the reference and Code. I need the code to change automatically depending on the criteria

If al data is: Reference: Code:
P P P P P P P P +
N N N N N N N N -

if at least one data is diferent then code will be X.

I hope someone can help me with this.

Regards

Import Multiple Text Files into Excel - beginner advice

I need some hand holding please. Zero experiences with VBA - step by step appreciated by me and the hordes of newbies...

I need to import multiple text files into an Excel spreadsheet.

the files are simple text, single line, single column no parsing needed.

I want to import multiple files into a column in a worksheet

folder = /filefolder/
files = textfile-01.txt
textfile-02.txt through textfile-250.txt

I want textfile-01.txt to be in C1
I want textfile-02.txt to be in C2 etc.

I got as far as ALT+F11 opens VBA editor....

thanks in advance

Combining Excel Sheets

I'm looking for a way to combine multiple excel workbooks. I have 84 workbooks that have the same header information but in different columns. Is there a simple way to combine them all together instead of manually copying and pasting all of the data into a master file?

Thanks!

Simple Spread Sheet

I honestly don't even know what to use for a search on this solution.

I am trying to set up a simple spreadsheet with two columns one being a Room# and the other being a Room Name. Is there a way to set it up so that I can enter the room number and the name auto populates in the next column?

Thank you

Count the number of records that fall between two dates

I am working with a database column B is the date and column C is a numerical value representing deliveries.

I need to find the amount of people who had "1" delivery between the two dates.

So far I have, =SUMIFS(C:C,B:B,">="&H1,B:B,"<="&H2)

=COUNTIF(C:C,"1")

If I could combine the two it would solve my question

">="&H1 is the start date and "<="&H2 is the end date.

Right now it sums all the numbers between the two dates. I need to sum all the people with "1" in column C not just everything.

I have attached the document that I am working on.

Thank You

Excel Nested IF Functions

I need help with a nested if function. I cannot get the formula to produce the correct result. The worksheet is attached.

Please help!

Deleting data from Sheet 1 Column 1 also deleting data from Column 1 Sheet 2 and corrosponding rows on Sheet 2

Not sure if a am phrasing the question correctly basically I need to add or delete the list of names in Column 1 on Sheet 2 based on if names in Column 1 of Sheet 1 are added or deleted. I have the formula in Column 2 Sheet 2 for this as =Sheet1!A2:A96. I then need the corresponding rows of data next to Column 1 Sheet 2 to also delete (excel is good about auto adding). I have attached a sample sheet. So if name20 is deleted on Sheet 1 I need name20 to delete on Sheet 2 and all of the data in the row to the right of name20 to also delete.

OnEntry, Worksheets_change question

Hello,

Is there a way to narrow OnEntry or Worksheets_change, not to a sheet but a range in that sheet.
To avoid to much back an foward to the code?

Thank you!

Changed Cell to Userform to Write Another Cell

Hello. I just started learning VBA yesterday and am trying to do this:

Let's say I have two worksheets (Sheet 1: "Presentation" and Sheet 2: "DataEntry"). Each worksheet has an identical 3x3 matrix in the upper-left corner (so A1:C3). I want to, using macros only, make a cell in "Presentation" match its corresponding cell in "DataEntry", each time a value is changed in "DataEntry" (and I do not want to restrict cell values to numbers-only).

Additionally, I want a form to pop up, immediately after changing a "DataEntry" cell which:

Code Screenshot

Download File from Url and SaveAs Overwrite if Exists

Hi All,

I have a code which i copied from the different sources, could you please guide on improving this query.

I want to Download a file and save the file in a given path and if the file already exist, it has to overwrite it.

Currently i have code only for downloading.

Code:

Private Sub CommandButton1_Click() 'Need to reference to Microsoft Internet Controls
Dim URL As String
'URL = Worksheets("References & Resources").Range("URLMSL")
URL = "Https://sampleUrl.sss" 'for TEST
Dim IE As Object Set IE = CreateObject("internetexplorer.application")

Option buttons

I am looking to assign the caption for my Option Buttons to equal the value of a cell for multiple cells.

An example of a single cell is:

ActiveSheet.OptionButton1.Caption = ActiveSheet.Cells(1, 1).Value

The above code works, but I am looking to use a loop since I am doing several iterations. I want to do this for about 50 option buttons, but I cannot figure out how to develop the syntax for the loop. The idea behind what I want to do is:

For i=i to 50

ActiveSheet."OptionButton" & i.Caption = ActiveSheet.Cells(i, 1).Value

next i

IF FUNCTION

Hi All

Hope some-one can help me. I need a FUNCTION that will take values between 4 and 6 and change them into 2. I am thinking the use of IF and OR, would do the trick.
One problem is the numbers have decimal values as well. e.g 4.05, 4.85, 4.1, 5.5 ...... so between 4 and 6 there maybe up to 200 different possibilities.

Thanking you in advance.

Tex to Column VBA Help for 1 Worksheet in Workbook

Hi,

I have the following code which works great for converting text to column in all worksheets within a workbook. I need to edit this code so it works for just 1 worksheet in a very large workbook (my worksheet is call "QueData"). I am a VBA novice. Any suggestions?

Thanks.

Sub text_to_column()
Application.ScreenUpdating = False
On Error Resume Next
For Each wksht In ActiveWorkbook.Worksheets
For Each col In wksht.Columns
Columns(col.Column).TextToColumns _
Destination:=Cells(1, col.Column), _
DataType:=xlDelimited, _

Converting Text

Hi All

I am new to this forum, hoping some-one can help.

I have imported text from another program into excel. When I try to use formulae on the text they dont work. e.g Vlookup and countif. I am definitely using the correct syntax. How can I resolve this problem? I have attached sample spreadsheet.

Thanking you in advance.

Cell reference for chart point

New to excel vba.. I am trying to reference a cell value for a chart point and I get an error at this line:

ActiveChart.SeriesCollection(1).Points(Sheets("Sheet1"), Range("C1")).ApplyDataLabels

Any help is appreciated

Display worksheet name into another worksheet based on a condition

I have an excel sheet with worksheets say A, B, C,D representing each of the sales unit. each of these sheets has rows of different sales risk say 1, 2,3,4 with a score associated with each risks

Another worksheet E has a column 'max risk' which fetches the max score of each risk from each of the worksheet A,B,C and D

Now i want to add another column in worksheet E, say 'Dept' which displays the worksheet name from which the max score has come from. Am unable to do this.

Example (worksheet E):

Risk No. Risk Desp Max Risk Score Dept 
1 Text 16 A

Syndicate content