Amend Macro To Select All But Last Column Of Data

May 12, 2014

Macro below - it now works and selects all the data in spreadsheet and converts to Proper Case

However I also need a macro to select all except the last column of data and convert all except the last column to Proper Case

It is for Post / Zip code info. so wish to keep it in Upper Case.

What I have already is:

Code:

Sub Propercase()
Dim LastRow As Long, LastColumn As Long
LastRow = Cells.Find(What:="*", After:=Range("A1"), SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
LastColumn = Cells.Find(What:="*", After:=Range("A1"), SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Column
Dim r As Range, c As Range
Set r = Range("A1").Resize(LastRow, LastColumn)

[Code] .....

I was hoping I could easily amend the above to select all except last column.

View 3 Replies


ADVERTISEMENT

Editting Macro To Select Last Empty Column To Paste Data

Nov 30, 2008

I have a macro that automatically takes data from one sheet, copies it and pastes it on another sheet, but I want it to select the empty column that is to the right of the last column to contain data (so basically the next empty column). What code would I enter into editting my macro to be able to do this please?

Also, one thing I've tried to do with my macro is that when I select the data, it's suppose to select from the first name to the last. When doing the actions for the macro, I use "Ctrl + Shift + Down Arrow Key" to make the selection select the bottom of the list. However, when running the macro, if the list is longer (or shorter), the macro selects that number of cells instead of the action of just going to the bottom of the list. For example, if during the actions of the macro, I recorded using the Ctrl + Shift + Down Arrow Key that 50 cells were selected...next time if I have 60 cells, only 50 are selected, even though I used an action command which should select all the cells in that group (in this case being 60). Is there some code I can add to that so this would work correctly?

In case its required, here is the code from the macro:

View 11 Replies View Related

Amend Macro To Run Through All Sheets Except Two

Feb 5, 2009

I have found and adapted a macro (below) that searches all worksheets for a specific value (entered by the user in a specfic cell) then displays a list of hyperlinks to the matching cell locations.

I now have a couple of sheets I don't want to be included in this macro ("Master List" and "Pivot Table") but I'm really struggling to find a way of amending the macro to exclude these. I've searched and tried a couple of ways but I get errors and I think I'm not knowledgable enough to know where to put each bit of code.

View 3 Replies View Related

Amend Current Macro To Protect All Sheets...

Mar 4, 2007

I have a Macro to protect all the Months sheets in my Time sheet to stop users deleting formulas, This year I've added a new sheet with a yearly calender so users can track Hols etc but when I run the Macro it protects this sheet "2007-2008". How can I amend the Macro so it protect all sheets except "2007-2008". My Macro is below:

Sub ProtectAll()
Application.ScreenUpdating = False
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Protect Password:="KITCHENsink19591968", DrawingObjects:=True, Contents:=True, Scenarios:=False
Next ws
ActiveWorkbook.Protect Password:="KITCHENsink19591968", Structure:=True, Windows:=False
Application.ScreenUpdating = True
End Sub

View 4 Replies View Related

Macro Code To Amend The Status Of Cell To Be Date?

Mar 31, 2014

I have a user form we are using to transfer data into an excel spread sheet. When transferring the date from a text field it is formatted as general, I need this to be a date format DDMMYYY. The cell needing formatting is N2

View 5 Replies View Related

Userform Data Amend/Modify Not Working

Feb 24, 2010

I am trying to develop some data package for my office and created Userforms to add/input data, and amend/modify data. To input its working fine. But when I want to amend/modify the records its not working. I am new to Userforms, Codes. Can anyone help me by rectify me coding, for which I am attaching the sample sheet.

View 13 Replies View Related

Amend Chart Data In Multiple Workbooks

Sep 5, 2007

In my VB6 project I need to loop through several Excel Workbooks with the same chart format and amend the chart data as required from time to time. There are 2 charts in Sheet2 of every workbook. With the following coding, I can only update the chart in the first workbook but not the one in the second workbook and the rest. It appears that there will be no further updates after the first workbook is closed.

Option Explicit
Dim oEquityWB As Excel.Workbook
Dim oEquityWS As Excel.Worksheet

Public Sub AmendChart()
Dim arrWorkbooks() as String'Path & Filename
Dim nn as Integer

For nn = 0 To UBound(arrWorkbooks)
If Not EquityWBOpen(arrWorkbooks(nn)) Then GoTo Next_nn
Set oEquityWS = oEquityWB.Worksheets("Sheet2")
oEquityWS.ChartObjects("Chart 1").Activate................

View 9 Replies View Related

Find & Amend/Edit Data Via Userform

Mar 30, 2008

A.) As a user is entering data into a userform two specific values need to be checked in the existing data sheet.

Textbox1 ( date)
Combobox (operation name) {4 tabs on from textbox1)

They relate to the data stored in columns 'A' and 'E' respectivly.

What I'd like is, as the user exits combobox4 to check if the values already exist. If they do; fill the coresponding textboxes with those values and allow the user to make any amendments, then have it SAVE to the SAME row, would a record number be necessary to accomplish this?

B.) For a future development, Im thinking of applying the same principle to a different project, where 3 values need checking.

Textbox9000 (date) Column 'A'
ComboBox1002 (Staff member) Column 'B'
Combobox1003 (operation name) Column 'C'

Possible complications are that below combobox1003 there will be 12 other comboboxes(a value title, from column header) with associated textboxes alongside(value previously entered by user).

There will be 22 possible values for the comboboxes(the values will be the same column headers) The user will only ever have the choice of making 12 entries though.

Does any one have any spare code laying round for this one..

View 9 Replies View Related

Automatically Count And Amend A Formula As New Data Is Added

Jun 7, 2006

[please refer to attached sample data]

The formula in K3 is

"=J15/10"

This formula calculates the average mailing return rate of all the mailings added together. J15 is currently white text to hide it from the end user.

Everytime I add a new row of data I need the formula to update itself automatically. So for example, the next time I add a row of data the above formula has to change to

"=J15/11"

Or if I were to add three rows of data the formula would have been

"=J15/13"

View 9 Replies View Related

Macro - Select Last Non Empty Column And Paste Information In Another Column?

Mar 25, 2013

I am trying to find a macro that look for last non empty cell in column A and them paste a formula/comment in all cells of column B.

View 3 Replies View Related

Macro To Select Cell After Last Row In Column

Sep 10, 2009

the macro code to select the cell after the bottom of a column of data e.g. I have data in A1:A300 and I require the macro to automatically calculate the last row in the range (in this case A300) and then to select A301 (in this case)

(I know I can record a macro but the number of rows can potentially differ every time I run the macro)

N.B. Excel version 2003

View 3 Replies View Related

Macro To Select Range With Column Header?

Mar 12, 2003

How would a code look like to select a range with a column header on top. in the code you provided, it selected the entire W column. How would you select the range given that the W column was called Address?

Sheets("Sheet1").Select
Range("W1").Select
Range(Selection, Selection.End(xlDown)).Name = "Problem_Area"

View 6 Replies View Related

Macro To Select Numeric Values In A Column

Jun 5, 2014

In cell A1 I have a countdown timer from an external source that counts down to 00:00:00 approximately every 10 minutes and then resets.

I need a macro to be triggered whenever 00:00:00 is reached.

The macro will select column AL and copy a range of cells (within AL) that contain numeric values only and paste these numeric values in the adjacent cells in column AM. It is important that the paste is values only and not formatting or formulas.

Column is being fed dynamic data from an external source and displays either #N/A or numeric values.

View 2 Replies View Related

Select Column Data By Date

Apr 18, 2007

I am looking for a macro that will put data from another worksheet by the date. So if A1 is 01/01/2007 I want to bring the information in from A2,A3,A4 and so on in A1 on the other worksheet. But if B1 is 01/01/2007 I want to bring the information in for B2,B3,B4 and so on in A1 on the other worksheet.

View 4 Replies View Related

VB Code To Select All Rows With Data In A Column

Dec 3, 2008

In my macro, I need code that will select all the rows that contain data in a given column, minus the first row which has a header.

View 6 Replies View Related

Select Arbitary Range Of Data In Column

Mar 4, 2009

I wish to collect an arbitary range of data in a column. Hence I wish to identify were the data begins (for example C10) and where the data ends (for example C22), and then copy it and paste it at another sheet. How to do that with VBA-code?

View 9 Replies View Related

Select Next Column After Data Input Into InputBox

Jul 18, 2009

Here is my delimma. I am using the standard InputBox for my users to input the number of errors found for each category in a record from a daily report. The problem I having is that every time the user types in data using the InputBox it overwrites the previous days numbers. I need to set up the InputBox code so that after the user has input the numbers for that day that the next time the InputBox is used it selects the next column to the right and continues to do this for each day.

View 4 Replies View Related

Select Column And Delete Row Where Data Is Duplicate

Nov 17, 2006

I've got this macro which works well, but I have to edit it to change the column I want to check for dupes. I don't mind doing that, but now I have to share the macro with someone who is not comfortable changing the references in the code every time they run it.

As it is it checks column G:G (7) for dupes and deletes the row. Good.
I'd like for it to do the same thing, but for whatever column the active cell is in.

I can use this:
Col = ActiveCell.Column
in place of the "7" in the With Range part
but I don't know how to replace the "G1:G".

Sub DeleteDuplicatesColumnG()
With Application
.ScreenUpdating = False
.EnableEvents = False

View 9 Replies View Related

Macro To Select Next Row Of Data And Save As

Aug 20, 2009

I am pretty much a novice at this whole excel / vba stuff, but I have been trying! unfortunately I have now got well and truely stumped! I require the macro to perform a loop and once saved the first row of data, select the next row of data (in exactly the same way) until it reaches the last row. The macro I have created does the first part fine, but I have reached the end of my knowledge base!

Below is the macro I have created:
Sub TEST_1()
'
' TEST_1 Macro
' Macro recorded 20/08/2009 by ..........'
'
Sheets("Input").Select
Range("A1:CI1").Select
Selection.Copy
Sheets("Results").Select
Range("G3").Select
ActiveWindow.LargeScroll ToRight:=7
Range("G3:CO3").Select..............

View 9 Replies View Related

Find Last Cell With Data In Column A Select All Up To A4 Then Format To Number

Oct 14, 2013

I am trying to find the last cell with data in a spreadsheet once this has been found select all up upto cell A4 and then format these cells into number format to zero decimal places so far I have the following which finds the last cell:

LR = Cells(Rows.Count, "A").End(xlUp).Row
Range(Cells(LR, 1), Cells(LR, "A")).Select

View 1 Replies View Related

Macro To Continue If There Is No Data To Select In Workbook

Aug 21, 2013

I have a macro that pulls in data from many workbooks. If there is no data in one of the workbooks the macro will not continue. Is there a loop or some other coding I need. The code for one of the worksheets is: (I am new to excel and know there must be parts that can be deleted in the below

Workbooks.Open Filename:= _
"J:SPORTSFORCESPORTSFORCE BUSINESS PLANSReporting spreadsheetCricket.xlsx"
Sheets("Numbers Report ").Select
ActiveSheet.Outline.ShowLevels RowLevels:=2
Range("A6").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Rows.Ungroup

[code]....

View 3 Replies View Related

Select And Copy Set Of Data In Column Based On Starting And Ending Values

Aug 26, 2013

I have a macro that copies three sections of data from a word document and pastes it within the Excel worksheet. The column of data is pasted in a single column (data to be space-delimited and evaluated later), and what I would like the MACRO to do is separate the three sections of data based on the starting and ending values of the section and place them in different columns.

Section 1 : starts with the word "Team"
Section 1 : ends with the word "City"

Section 2 : starts with the word "Location"
Section 2 : ends with the word " Date"

Section 3 : starts with the word "Member"
Section 3: ends with the word "Age"

So section 1 would be pasted into cell C1, section 2 pasted into G1 and section 3 pasted into J1.

Each section will have vary in number of rows between the starting/ending values, so to cut and paste the section based on the starting and ending value is vital.

View 7 Replies View Related

Data Validation List To Select Worksheet In Macro

Apr 8, 2007

I have a Data Validation list in cell A1 of a worksheet called LIST. I would like to modify the macro that I have recorded, the macro uses data from various worksheets. I would like to sort out some code so that at certain points in the macro it will select the worksheet that is shown in cell A1 of the LIST sheet and then carry out the code already recorded. THis will allow me to quickly change a sheet name that is refererred to in the macro numerous times without actually manually editing the sheet name in the macro code.

View 7 Replies View Related

Userform One Combobox Three Data Columns Select Required Column Based On Radio Button

Jun 10, 2013

I have a user form that has one combo box on it that right now references one column of data.

Now I am being asked to have three columns of data and the combo box to show one of the three when a certain criteria is met.

I believe it would be easiest to have an additional combox with a change event when the box is populated with "whatever" in the field

So S:3 to S:5 have A, B, C

And EC:1-EC:59, ED:1-ED:59, EE:1-EE:59 contain the data that should show when S:3, S:4, or S:5 is selected.

If S:3 is selected then the list in EC:1 - EC59 would show and so on.

View 2 Replies View Related

Amend Match For Min & > 0

Jun 8, 2009

I need to amend this formula so match only cells with min values > 0.

View 3 Replies View Related

Amend Code To Run Faster

Sep 5, 2008

I have the following code kindly supplied to me by someone else and I'd like to know if anyone can suggest any ways to speed up the running of it. It currently takes about 4 minutes to run (there are about 5000 cells to loop through)

Basically it looks for a value in Col C - works out the number of rows to fill up by searching a range in Col D - then copies value in Col C up by that number of rows.

View 10 Replies View Related

Amend To A Database Daily

Dec 31, 2009

I have a daily log for work that keeps track of purchases and returns among other items and I was wondering if there was a way I could have all this information get put into a log that will amend everything for each week, month and year.

View 14 Replies View Related

Amend Csv File From List

Jun 7, 2009

I have a csv file (Import.csv) containing rows similar to the following:

001032,117.5,19/09/2005,Ref1,Ref2-1,100,44100,#Sales#,,Import routine
001033,129.25,19/09/2005,Ref2,Ref2-2,110,44100,#Admin#,,Import routine
I also have a worksheet with the following list (which will grow):

Cost Centre Codes

AB1DepartmentCode2AdminADM3SalesSAL4StoresSTO5PurchasingPUR

Excel tables to the web >> Excel Jeanie HTML 4

The deprtment codes in the csv file are all contained within '#' markings.

I need a macro that will find and replace all department codes in the csv with the relevant Code from the list, and remove the '#'s. Unfortunately, some of the fields are numeric with leading zero's so I dont want to lose these by opening and re-saving the file in Excel as a csv.

The output for the above is as follows:.........................

View 9 Replies View Related

Macro To Copy Data From Previous Column Into Next Free Column

Aug 20, 2014

I have a spreadsheet which is updated daily. Row A of the sheet has the date in it, and every day a new column is created for the that set of data. I have the below code which works at the moment:

[Code] .....

I want to use this same code on another spreadsheet to do the same process (I need to copy and paste 4 columns (A,B,C + D, into E, F, G & H, then tomorrow it will copy E, F, G & H into I, J, K &L etc etc)). The problem I'm having is that A1:C1 is a merged cell, then D isn't (used as a border to separate). So when it is copied I need to select the merged cell columns and column D (i.e. A:C & D on day 1) and paste it into E:H with E1:G1 merged.

View 5 Replies View Related

Retrieve And Amend Records From Database

Apr 11, 2008

I am a building a database where each row represents a record. Each record has a unique identifier number.

In worksheet "Record Search and Amend", I have recorded a macro to look up the data.

The problem is once the record is retrieved I need to be able to amend the record and save it back into the database in the right row. This could be another button to initiate this action.

View 14 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved