Advertisement

05.11.2008 at 11:48AM PDT, ID: 23392958
[x]
Attachment Details

Macro to start at any generic cell

Asked by rayboy28 in Microsoft Excel Spreadsheet Software, Spreadsheet Software, VB Script

Tags: Microsoft, Office, 2003, Excel

Hi all,

I have a database of sales records.  Everyday I append records to this database. Each day I have more than 100 records to append and then need to do certain steps on each record (move certain data to populate specific columns and to set the day for each record.)

I've done the below macro, however it runs only on the SAME ROW when recording the macro. So if I've recorded the macro on row 10, the macro runs only on row 10.

Sub FormatRecord()
'
' FormatRecord Macro
' Macro recorded 11-05-2008 by Rayboy
'
' Keyboard Shortcut: Ctrl+k
'
    Range("D10").Select
    Selection.Insert Shift:=xlToRight
    Range("K10:M10").Select
    Selection.Insert Shift:=xlToRight
    Range("D10").Select
    ActiveCell.FormulaR1C1 = "=TEXT(RC[-1],""dddd"")"
    Range("K10").Select
    ActiveCell.FormulaR1C1 = "=+RC[-2]*RC[-1]"
    Range("K11").Select
End Sub

1. How can I run the macro on any row (11, 12 & so on) coz I'm keeping on appending records below.
2. Is there a way to choose all of my records for the day (say 50 records) & tell the macro to run on all 1 by 1. Or do I HAVE TO go to each record & say run on row 11, now on 12 etc.

Any help is much appreciated.

Thanks Start Free Trial
[+][-]05.11.2008 at 11:54AM PDT, ID: 21543173

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.11.2008 at 11:55AM PDT, ID: 21543174

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.11.2008 at 12:26PM PDT, ID: 21543230

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.11.2008 at 01:28PM PDT, ID: 21543395

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Excel Spreadsheet Software, Spreadsheet Software, VB Script
Tags: Microsoft, Office, 2003, Excel
Sign Up Now!
Solution Provided By: zorvek
Participating Experts: 1
Solution Grade: B
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628