Macro - Moving Active Cell To Column B Of Next Row

Feb 14, 2012

I use this macro to open a hyperlink in "column B" of the next row. However, it only works if I begin the macro from "column N" on the line above. (the hyperlink is always located in column B)

I want to be able to run this macro from any cell on the line above. How to modify it?

Code:
Sub Open_Hyperlink()
'
' Open_Hyperlink Macro
'
' Keyboard Shortcut: Ctrl+o
'
[Code]...

HTML Code:

ABCDEFGHIJKLMNO
1ActiveURLWhatDateFirst NameLast NameOtherOther2Other3Street1CityStateZip
2XLinkData112/21/2011BobSmithData2Data3Data4123 MainMooresvilleNC28117
3XLinkData112/22/2011LarryJonesData2bData3Data4456 MainMooresvilleNC28117
4XLinkData112/23/2011MaryAkinData2Data3Data4789 MainMooresvilleNC28117
An example would be to run it while Cell "I2", "J2", or "K2" is selected and have it open "B3"

View 2 Replies


ADVERTISEMENT

Moving Active Cell In Same Row To Column A

Jun 28, 2009

In my macro, I need to, from any column, move the active cell to column A, while remaining in the same row.

View 2 Replies View Related

Macro To Filter Column On The Basis Of Active Cell Value?

Jun 28, 2014

I want a macro which can filter the data on the basis of active cell

View 1 Replies View Related

Excel 2010 :: Macro To Filter Column Based On Active Cell Value?

Feb 25, 2014

I work on an excel spreadsheet all day and I'm constantly cuting and pasting a value to filter another column. I would love to have a macro button that would automatically do this.

The job card sheets are labled 'Page 1' through to 'Page 175'. As I am working on each job card sheet I need to filter column on another sheet within the same workbook. This is indicated on the attached picture.

So in a perfect world as I would enter in the PLANT ID number on to any job card, then hit a macro button on the toolbar and the Pole No column would then be filtered by the value in the PLANT ID cell.

As there are multiple job cards the macro would probably need to use the 'active cell' value to filter by. But as you can probably tell I'm no expert so you judge the best way to do it.

MWTS034G22 Job Card Sheet
[URL] .....
Windows 7 (32bit)
MS EXCEL 2010

View 2 Replies View Related

Macro Optimization And Moving Text From One Column To Another And Deleting Previous Column

Nov 7, 2009

I am running Win XP and Excel 2003.

I have a macro I found here on the boards written by Lenze to delete an entire row based on what is found in column A. I would like to delete any row where Col. B contains 10 or less characters and I have modified it to do so (or at least I think it does). My problem is that it takes about 12 minutes to run the macro (I have about 50k lines to run through). I was wondering if this is the fastest method or if it examines things other than just column B.

Sub Test()
Dim i As Long
LR = Cells(Rows.Count, "B").End(xlUp).Row
For i = LR To 2 Step -1
If Len(Cells(i, "B")) < 11 Then Cells(i, "B").EntireRow.Delete
Next i
End Sub
After this runs, I am left with Columns A to somewhere around AH. The columns are generally in the format of text followed by a numeric column. An individual text column has the same name through all of the rows. The numeric columns have varied values whether negative or positive.
Ideally what I would like: If a given cell (ie. C2) in Row 2 is numeric, then copy the cell to the left (ie. B2) into (ie. C1) and then delete Column B. I need this to work for multiple columns from B to C, skip D and E, and then from F to AG (and maybe beyond).

View 9 Replies View Related

Macro To Paste In Certain Column, Moving Over Each Time

Mar 31, 2007

I have this macro listed below that finds all these files, copies cells from stat sheet and places them in sheet1 in another file. It keeps looping till all is found and done.

My problem is when it goes to paste in sheet 1 I want it to shift over a row each time.

Right now during the first pass it pastes in column B, I want it to start in column D

The issue seems to lie right under where it says "Put data into workbook"

Public Sub PullData()
Dim wkb As Workbook
Dim lngStore As Long
Dim strDate As String
Dim strName As String
Dim Book As String
Dim Sheet As String
Dim week As String
Dim Store As String

Dim IngRow As Long
Dim strCol(0 To 15) As String

strCol(0) = "b"
strCol(1) = "c"
strCol(2) = "d"
strCol(3) = "e"
strCol(4) = "f"
strCol(5) = "g"
strCol(6) = "h"
strCol(7) = "i"
strCol(8) = "j"
strCol(9) = "k"
strCol(10) = "l"
strCol(11) = "m"
strCol(12) = "n"
strCol(13) = "o"
strCol(14) = "p"

View 9 Replies View Related

Moving Down A Cell Within A Macro

Apr 23, 2007

What I need to do is have the macro move down a cell each time the data is pasted -

Sub saleschartnew()
ActiveWindow.ScrollRow = 3
ActiveWindow.ScrollRow = 2
ActiveWindow.ScrollRow = 1
Range("G3").Select
Selection.Copy
Sheets("Monthly Sales Chart").Select
Range("E10").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Entry form").Select
Range("C13").Select
Application.CutCopyMode = False...............

I did search and found this: activesheet.cells(row,Col).offset(0,1).value = " Properties"

However, my knowledge of VBA is basically zero so I am not sure how this would be implemented into the macro.

View 3 Replies View Related

Moving Data From One Column To Another But Only If Cell Is Blank.

Oct 29, 2009

I need to move data from columns B & C into A without losing current data in column A (see attachment). I'm sure I know how to do this but cannot for the life of me remember how.

View 5 Replies View Related

Go To Last Active Cell Column

Apr 7, 2009

I have a macro where I sum a large number of cells in column AZ. How can I have the Macro end in the last cell of column AZ where the sum is located? The length varies in each file.

View 3 Replies View Related

Adding Formula To Macro Based On Moving Cell?

Jan 14, 2013

I am having difficulty expressing a formula so that if a cell is greater than zero, it adds the value of that cell to a String figure. I have got as far as the following, the 'problem' area is in red.

Sub Share_Sales3()
Dim Prompt As String
Dim Caption As String

[Code].....

View 3 Replies View Related

Find SECOND Last Active Cell In Column

Jan 15, 2010

I use the Index/Match formula to find the last active cell in a column quite effectively.

I'm wondering though how to adapt it to find the second last active cell?

EX: Last active cell formula:


Data:
a 10
b 11
c 0
d 12

View 10 Replies View Related

Select Top Cell (row 1) In Active Column

Apr 23, 2014

I want a simple macro which will go to the cell in row one in the active cell's column

View 2 Replies View Related

Locate The Last Active Cell In A Column

Dec 2, 2008

Is there a formula I can use to locate the last active cell in a column. I did use the count function, however this isn't always reliable if there are blank cells within the column

View 5 Replies View Related

Find Name Of Column Active Cell Is In

Jul 7, 2006

I have a code which looks at sheet2, useing a date value, and returns the Vent value and the Tanker value to sheet1. Because of the file size I have pasted a small section of Sheet2 in the hopes you can see what I am doing. As can be seen my code is not going to work with Offset as soon as the Data fills further down the sheet(every 2 weeks). I need a way to reference the active cells column name (it is a named range) or header name. Both are the same. That is the header name is the same as the name of the range. there is a way to perhaps find the first cell of the column,which I guess would work,but have reached a stale mate with what I've tried so far.

Vent 01Vent 02Vent 03Vent 04
Date3/06/063/06/06n1/06/06
Tanker8248824617606
WhoJ AshJ AshEmptyHarry
Date
Tanker
Who

Private Sub DueCommandButton_Click()
Dim strRecordID As Range
Dim rngData As Range
Dim Vents2 As Range, Tanker_Result As Range
Dim wsheet1 As Worksheet, wsheet2 As Worksheet
Dim Column_Name As Range
Dim ActiveCell As Range
Set wsheet1 = Worksheets("Sheet1")
Set wsheet2 = Worksheets("Sheet2")....................

View 2 Replies View Related

Use Active Cell Row To Check Another Column

Dec 22, 2006

I've been racking my brains trying to figure this out but cant, please can someone assist. I need to write some vba code that looks at cells in column aa and ag (on the same row) and displays a message is ag > 0 and aa <> "Agency".

View 8 Replies View Related

Sort By Active Cell Column

Jan 7, 2007

I am trying to perform a sort based on the ActiveCell.Column

I thought my code would exclude the hearer rows, but presently it moves the header rows beneath the data

I tried
Header:=xlGuess as well as
Header:=xlNo

Same result

What am I doing wrong?
Thanks
-marc

Private Sub comp_mySort()

Selection.Sort Key1:= Cells(1, ActiveCell.Column), _
Order1:=xlAscending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

End Sub

View 9 Replies View Related

Set Variable To Row & Active Cell Column

Jan 8, 2007

I have a sort procedure I have been working on. Sort By Active Cell Column
Now I would like to make sure the row of the activecell.column is row 7. I tried

Private Sub comp_myMonthlyReport_SortAscend()
Dim rng As Range
With ActiveWindow
rng = .ActiveCell(7, .ActiveCell.Column)
End With
Selection.Sort Key1:=rng, _
Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End Sub

But I receive this error: Run-time error '91': Object variable or With block variable not set

View 6 Replies View Related

Macro With Reference To Active Chart On Active Sheet

May 14, 2014

I currently have the following macro running to set a chart's data values:

Sub C3Quarter12013()
'
' C3Quarter32013 Macro
'
'
ActiveSheet.ChartObjects("Chart 2").Activate
ActiveChart.PlotArea.Select
ActiveChart.SeriesCollection(1).Values = _

[Code] ......

When I copy the tab and change some of the data within the cells, I want the macro refer to the chart on the current tab and the values in the current tab - as currently it refers to only "Chart 2" and the values in the tab 'Figure 2 - WE OPH'.

I've tried changing the sheet name to ActiveSheet.name but that doesn't seem to work.

View 4 Replies View Related

Find Column Based On Active Cell

May 16, 2013

How to find the column based on my active cell...if my active cell is in A1 then it pops up saying your in column A.

View 3 Replies View Related

Highlighting Active Cell's Row, Along With Any Row That Shares Same Value In That Column

Sep 25, 2009

Is it possible to click on a cell in column C, and have the wishlist below happen:

That active cell's row is hightlighted.

Any cell in that column that has the same value as active cell is also highlighted.

Plus, any cell in another sheet that has that value it's row is highlighted too.

Example:

I click on C5 in Sheet 2 its value is 45000789 it row is highlighted, this value also appears in C3 in the same sheet, so it's row is highlighted as well. Plus, in sheet 1 in C10 this value appears and it's row is highlighted as well. When any of the values are clicked again the highlight is removed from all parties.

View 9 Replies View Related

Change Active Cell Value In Hidden Column

Apr 11, 2007

The attached sample workbook has a listbox of areas in a userform. The Textbox on the user form is so that the user can edit the Area names in the listbox. The userform functions fine as long as the column that contains the area name is not hidden. What I want to be able to do is edit the Area Names using the Textbox with the area name column hidden.

View 2 Replies View Related

Identify Active Cell And Use The Column To Add Formula To Another Cell

Dec 1, 2009

I have a range of unlocked cells (B5:S10) that users enter data in. This sum of this data is then charted. The formula (sum) in a cell equals zero even when there is no data entered by the user. This zero is then charted.

I need to be able to plot the zeros if the user enters zeros but not plot the zero if the cells are blank.

What I was attempting to do is to use the worksheet change event to add the formulas to a cell so that the chart does not plot the value until something was added.

In my change event I need to know that a cell in the range (B5:S10) was changed and that if it was D7 (for example) that I need a formula enterd in D11 [=SUM(D5:D10)]. If it was I5 then the formula would have to go in I11 [=SUM(I5:I10)].

View 8 Replies View Related

If Active Cell Is Empty Then Run Macro?

May 22, 2014

My code and see why it's not executing properly?

[Code] .......

View 7 Replies View Related

Macro To Select The Row That The Active Cell Is In

Aug 21, 2009

Using vba how do I tell a macro to select the row that the active cell is in?

I'm just using a basic delete Row macro but I'd like for the macro to automatically select the entire row when it's time to delete instead of me highlighting the section.

View 2 Replies View Related

Enter Active Cell With Macro

Dec 20, 2013

Is there a way a person can enter the active cell and have the cursor go to the upper left part of the cell and enter the current date and remain in that cell for additional data? More often than not there will already be data in the cell but sometimes it will be blank.

View 7 Replies View Related

Return To Active Cell After Macro Run

Jul 24, 2007

I am using Excel to tabulate scores for my employees. We work in a very busy and open office, so there is a need to be able to obfuscate the scores, but also help keep from losing my place while punching the scores.

I would like it to be able to return to the last cell that I was punching a score in...I used "ActiveCell.SpecialCells(xlLastCell).Select". I have also used " x= cells(Rows.count,2).end(xlUP).row" followed by "cells(x+1,2).select", but both with no luck...

Sub Hide_Scores()
Range("B15:EU35").Select
ActiveSheet. Unprotect
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0

View 6 Replies View Related

Assign Active Cell In Macro With Dynamic Cell Choice

Dec 29, 2009

Before unloading a userform the range to select the active cell is set to

View 3 Replies View Related

Highlight Row And Column Of Active Cell In Large Spreadsheets

Apr 4, 2013

Is there a way to highlight the row and column of the active cell? The highlighting will move as the active cell is moved around the spread sheet. I have a newbie manager that is bugging the pea-turkey out of me! He wants to be able to easily see where he is within some of our sheets while he is in a vehicle or outside on a job site...seems like an "accessibility" type issue, but can't find anything in Excel "Options."

View 5 Replies View Related

Extend Selection From Active Cell To Desired Column

Apr 15, 2008

1st post so hope that title isn't too vague.
Using VBA, I have a macro that will find a column based on a week number and add in a new column.
It will then offset the ActiveCell down one.
I now need the macro to SUM all values in that row to the left of the ActiveCell.
My original thought was to use:

ActiveCell.Offset(1, 0).Range("A1").Select
Range(Selection, Selection.End(xlToLeft)).Select

Unfortunately, there are gaps in the data field, blank cells that should count as zero value.
How can I highlight all cells to the left, from whichever column the active cell is in, through to column B?

View 6 Replies View Related

Can A Macro Start From Wherever Cell The Active Cursor Is On

Apr 5, 2006

Can a macro start from wherever cell the active cursor is on? or
perhaps from the cell that the macro button is clicked?

What I am trying to do is copy the data from F(whatever) to whatever
the last empty cell is in the row holds the active cursor. Or I can
create buttons for the macro to run, and it could copy the information
in that particular row.

View 10 Replies View Related







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