Computer Support Forum

Excel Email Macro

Question: Excel Email Macro

Hi

I am trying to write a macro in Excel 2003 to automatically send an email using Outlook to a list of individuals asking them to confirm their personal details using the attached template. Could someone show me where I am going wrong with the script please?

Many thanks

Relevance 100%
Preferred Solution: Excel Email Macro

I recommend downloading and running Reimage. It's a computer repair tool that has been proven to identify and fix many Windows problems with a high level of success.

I've used it in the past to identify and fix everything from blue screens (BSOD's), ActiveX errors, corrupt files and processes, dll/exe/sys errors, recover lost memory, Windows update problems, defragging, malware removal etc.

You can download it direct from this link http://downloadreimage.com/download.php. (This link will automatically start a download of Reimage that you can save to your computer.)

Answer: Excel Email Macro

16 more replies
Relevance 70.93%

Hello,I got a macro online for sending emails given a condition. It works great if you have 1-2 entries that require email sending based on the condition set. But when it sends up to 10 mails daily to the same person it becomes kind of annoying.I will post the macro I use below, but first I want to say what I would like to do and don't know exactly how (I am a beginner at VBA language):--> I want to modify the macro so that for multiple entries as per the condition, it sends only 1 email with all the entries specified in body.The columns are:A - name of the person to send email toB+C - email and CC emailD - condition, if yes send email, if no don'tE - company nameF - current no.G - sector to be auditedH/I - date to begin / end auditJ/K - days left until beginning / end of the auditL - audit done: if yes, column D becomes no and greenAnd here is the macro I use:Sub audit()
Dim OutApp As Object
Dim OutMail As Object
Dim cell As Range
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")

On Error GoTo cleanup
For Each cell In Columns("B").Cells.SpecialCells(xlCellTypeConstants)
If cell.Value Like "?*@?*.?*" And _
LCase(Cells(cell.Row, "D").Value) = "yes" Then
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = cell.Value
.CC = Cells(cell.Row, "C").Value
.BCC =... Read more

More replies
Relevance 68.88%

Any way of controlling the time a email is sent via a excel spread sheet using vba?
 

Answer:Excel - macro email-

6 more replies
Relevance 68.88%

I have an Excel model (office 2000) which has a range of cells that contain if/then statements. I'm trying to get Excel to automatically send an email if any of the cells within that specified range were to provide a value that was false. Is this possible? Thanks for any insight.
 

Answer:Email Macro in Excel??

16 more replies
Relevance 68.88%
Question: Excel Email Macro

Hi All,

I have a spreadsheet and i am needing to create a macro that will opena new message in Outlook and populate the 'To' Field with one cell and then the 'CC' field with 2 email addresses, one from one field and the other from a different field. then the subject from another field and then the body from another. it then leaves the message window open so i can check it right and hit send.

I found the script the other day but can not find it anywhere including this site.

Any help on this will be great.

JPL

Any
 

Answer:Excel Email Macro

Hi JPL,

You could use this function, just pass the values to it
Code:

Function MailData(mSubject As String, mMessage As String, Sendto As String, Optional CCto As String)
Dim eSubject As String, EBody As String
Dim app As Object, Itm As Variant
Set app = CreateObject("Outlook.Application")
Set Itm = app.CreateItem(0)

With Itm
.Subject = mSubject
.to = Sendto
If Not IsMissing(CCto) Then .CC = CCto
.Body = mMessage
' .Attachments.Add (NewFileName1) ' Must be complete path
.Display ' This property is used when you want
' .send
End With
Set app = Nothing
Set Itm = Nothing
End Function

It's from one of the posts, I do not remember which one
 

1 more replies
Relevance 68.06%

I have a user who wants to create a macro which will automatically send an excel spreadsheet into outlook and email it.
Any suggestions welcome. Thanks.
 

More replies
Relevance 68.06%

My sense is this is a pretty simple request, but I'm completely illiterate when it comes to VB.

I have an excel spreadsheet with a number of data points. I'm looking to export the entire sheet to a CSV file and send it via Outlook. Any suggestions?
 

More replies
Relevance 68.06%

Windows 7 --------------------------------------------------------------------------------First thing...I know nothing about macros!! I do know a very little about formulasI have created "IF" formula in excel 2010, based on a date it will create a send due in column "E", =IF(D5=$A$2,HYPERLINK(mailto:"&$K$1&"?subject="&A5&-B5&"&body="&$C$3,"sendworks great but, I have to go thru 86 rows in column "E" and hit "Send Due" numorous times,then hit send again on all the emails, can we automate this some how, like a macro that engadges when I open my outlook every morning?Thank u

Answer:Need Macro to automate email from excel

I have written code in Outlook, which is essentially a template, you fill in the details, all sorts of stuff happens accordingly to what you have selected, and you press send and it will send the emails to whoever it is you want. Iv done this in Outlook, so my question is, why do you need this to be done in Excel? is Outlook acceptable?

3 more replies
Relevance 68.06%

Hello all;

I am new to this forum and also to Excel macros. I have a large Excel file detailing financial accounts with my small business.
Anyway, I would like to email any customer who has an overdue balance as per column V in my attached sample file (any customer with a greater than zero value in V). I would like to send an email; something like this:

Joe Wilson;
As of 2/28/11 (latest date in the row that is on/after the current date), your account is currently overdue and you owe $1500.00 (G3).
Thank you.
Treasurer
I found several other threads explaining how to send an automatic email from Excel, but I haven't found one for sending an individualized email to a list of recipients. If this question has been answered, please feel free to redirect me. Otherwise, I'd appreciate any suggestions. Please let me know if I can detail my needs any better.
Thanks!
 

Answer:Excel Macro: Auto Email

welcome to the board.

I put some code in the sheet

The macro name is CheckAndMail

Let me know if this is what you need

PS: I just corrected something I came accross and have re attached the corrected sample
 

2 more replies
Relevance 67.24%

Hi - I have a list of names for a particular company where I have the first name and last name of the customer plus the email naming convention their company uses. For example the company's email naming convention is: [email protected] Is there a way I can create an Excel Macro that will automatically create the email from the available information? For example if I create three columns where one has the first name, last name and the @companyurl.com?I hope someone can help with this as it will save a lot of time!!Thank You!

Answer:Need Excel macro to creat email address out of just a name

This can be done fairly easily, but I'm not going to offer any suggestions.Since it appears that you do not work for this company, I can only assume that this will be for some sort of mass, unsolicited mailing. If your project was sponsored by the company in question, they would supply you with a distribution list and you wouldn't have to build your own.For all I know, I'm on that list of names that you have and I don't need any more unsolicited email.Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

3 more replies
Relevance 67.24%

Hi there,

I have a workbook which i would ideally like to send an automated mail when the date is within 30 days of "Todays date" .
I have found something similaar on past posts whichprints certain cells to an email but is triggered by a button press not date, but wondered if anyone could adjust it for me as my excel knowledge is very limited.
I really am struggling.

The password for the spreadsheet is Kalibratedbyme (capital K)

Best regards and many thanks!
 

Answer:macro to allow a date to send an email in excel

The content is different but why are you duplicating a post?
 

3 more replies
Relevance 67.24%

I would like to ask for an Excel macro which can send an automate email on a certain date every Month.

The dates would be as follows:

1st Monday: Email should be sent to [email protected] automatically
2nd Wednesday: Email should be sent to [email protected] automatically
3rd Tuesday: Email should be sent to [email protected] automatically
3rd Tuesday: Email should be sent to [email protected] automatically
3rd Tuesday: Email should be sent to [email protected] automatically

Subject line: ABC123D5679_Data transfer expected today

Details of the body of the text message:

"Dear All,
This is to remind you that we are expecting the data transfer to be posted in Novartis system today . This is just an advanced intimation.

Kindly let us know if you foresee a delay in the data transfer.

Kind regards,
Rohit"
Many thanks in advance for your help guys. This means a lot.
 

More replies
Relevance 67.24%

Hello

I need to come up with a simple outlook macro (or script?) that fires off whenever a new email meeting certain criteria is received.

1. new email is received with "please refresh quotes" in the subject
2. outlook runs a macro that causes another macro to run (the second macro is located in a excel workbook which is already running in my office pc)
3. the excel (attached) is simply refreshing market prices and emails whenever the macro is triggered. because the quotes are obtained via a DLL feed I can only get it at work.

the purpose is simply to get live market quotes on my personal email from my work email whenever i need.
thanks in advance for your help.
 

Answer:Solved: Run excel macro when new email is received

9 more replies
Relevance 66.42%

Hy guys

2nd time i am posting stuff for help, and as i was helped before i will again look forward the response.

I have a file of excel, in which i am sending emails to different candidates of admission, with scan letter placed in the same folder by name.

I want to edit this code, which could select attachment based on Column A list adjacent to the email address

I am attaching the file also pasting the code

Sub Test1()
'For Tips see: http://www.rondebruin.nl/win/winmail/Outlook/tips.htm
'Working in Office 2000-2013
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Dim SigString As String
Dim Signature As String
Dim cell As Range

Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")

On Error GoTo cleanup
For Each cell In Columns("B").Cells.SpecialCells(xlCellTypeConstants)
If cell.Value Like "?*@?*.?*" And _
LCase(Cells(cell.Row, "C").Value) = "yes" Then

Set OutMail = OutApp.CreateItem(0)

strbody = "We at Graduate School of Engineering Sciences and Information Technology are extremely pleased to know that you have selected Hamdard University as preferred choice for your graduate/post-graduate Studies. " & vbNewLine & vbNewLine & _
"Hamdard University is a pioneer Higher Education Institute (HEI) of Karachi producing Masters and PhDs in the fields of Engineering, Computer Sciences, Information Technology, Energy and Environment since 19... Read more

Answer:Attachment based on cell value in a excel email macro

anybody ???
 

2 more replies
Relevance 66.42%

Hi
I need help writing a macro that takes an Excel file to email.

The Excel file is a data base, I wanted the Macro to take the email from a column of the Excel file, and send out the email to all the emails in the database, if possible also adding a column of the Excel file to address the specific person.

thank you.
 

Answer:need help writing a macro that takes Excel file to email

Can you post a sample file? Please remove any sensitive data.

Rollin
 

2 more replies
Relevance 66.42%

Hi:
I am very new to Excel 2007 and macros. I have a spreadsheet that I am trying to get to send an email reminder to the point of contact [ col b ] 5 days prior to the closure document due NLT date [ col m ]. I am looking for assistance in writing a macro which will accomplish this if it is possible. I have attached the spreadsheet that I referenced.
Your assistance would be greatly appreciated.
Thanks in advance.

desantisj
 

Answer:Excel 2007 Macro to Send Reminder Email

desantisj, welcome to the Forum.
There are already 3 or 4 posts on this forum that have the VBA code (Macro) that you can modify for your Workbook if you can read the code. Zack has written the code so it is a bit complicated, but it should be a case of substituting your Cell references that hold the data for the ones that others have used.
Otherwise it is a case of waiting for an Excel guru to come along and help. If none of them come along I can probably help you, but I normally work with Access.
 

2 more replies
Relevance 66.42%

Hello,

My first post, sorry to be a leech right off!

I'm trying to automate some of my day to day emails. I'd like to get a macro set up that will send an email from Excel and paste the range I select in to the body of the email. Would be great if it would send to a list of addresses listed on the page as well.

Using the attached example, I'd like the macro to take whatever range I highlight on the table, copy it to the body of an email and send it to the group of emails listed on the right side.

I'm learning excel, this would help me a lot! I'll be editing this to fit a variety of other tasks. I hope it can be flexible. Thanks in advance.

Chris
 

Answer:Macro: Email Range/Selection to group from Excel

http://www.rondebruin.nl/mail/folder3/mail4.htm

I have done the looping attached.
 

2 more replies
Relevance 66.42%

Hi there - Using MS Access 2007.
I have a FORM with a macro that runs a query to generate ONE excel file and attaches to email using MS Out look to send out. - That Works great.

Problem: Multiple users to send email & attachment.
I would like for the macro to generate excel file (S) - based by the UID.

Can someone suggest a better way of handling this that is not time consuming?

Thanks In advance!
 

Answer:MS Access 2007 - Macro > Excel > Auto Email

Access can open Outlook and send an attachment to mutiple recipients either as a list or as individual emails.
So are the attachments all the same for the recipients?
 

1 more replies
Relevance 66.42%

I found this code in this forum.
i want to add recipient as CC or BCC. What is the correct code for that?
Thanks in advance!

Code:
Public Sub email()

Dim SubJ, Recip As String

SubJ = "Enter your suject"
Recip = "[email protected]"


ThisWorkbook.SendMail Recip, SubJ

msgbox "Email Sent"

End Sub

 

Answer:Send excel sheet ( email) through macro with recipient and cc

6 more replies
Relevance 66.01%

I found how to send an email from an Excel Macro (http://forums.techguy.org/business-applications/1056070-solved-excel-email-outlook-code.html)

Here is the code I'm using:
Code:

Sub Email_Test()
'
' Macro11 Macro
' Keyboard Shortcut: Ctrl+r
Dim eSubject As String
Dim Sendto As String
Dim CCto As String
Dim Body As String
Dim app As Object
Dim Itm As Variant
Set app = CreateObject("Outlook.Application")
Set Itm = app.CreateItem(0)
'Populate variables

mSubject = "Excel EMail Test"
Sendto = "[EMAIL="[email protected]"][email protected][/EMAIL]"
CCto = ""
mMessage = "You have received Knowledge Document Feedback for your domain."

With Itm
.Subject = mSubject
.To = Sendto
If Not IsMissing(CCto) Then .CC = CCto
.Body = mMessage
' .Attachments.Add (NewFileName1) ' Must be complete path
.Display ' This property is used when you want
' .send
End With
Set app = Nothing
Set Itm = Nothing
End Sub
Is there a way to format the message section with bullets? How about paragraph breaks?

Name: John Doe

Date: 6/15/2012
Doc #: KM123456
Etc:
Etc:
Comments:
I'm perfictly willing to look at how-to documentation if someone can point me in the right direction.

Thanks
firstshot
 

Answer:Solved: Formatting Excel Macro Email Message Section

Hi, I haven't really looked myself but instead of bullets I generally use a dash and a tab
Paragraph as such are not possible but you have the linefeed and carriage return

example to add to your macro code before calling the mail proc
Code:

Dim mytext as string
mytext = vbnullstring
mytext = "Dear Jon Doe" & vbclrf & vbcrlf
mytext=mytext & "-" & chr(9) & "Date :" & the date variable & vbcrlf
mytext=mytext & "-" & chr(9) & "Doc #:" & the dos variable & vbcrlf
mytext = mytext & "-" & chr(9) & "Etc :" "etcetera"
mytext = mytext & vbcrlf & vbcrlf
mytext = mytext & "Sincerely yours," & vbcrlf & vbcrlf
mytext = mytext & "Jane Doe" & vbcrlf

vbcrlf can also be replaced wij Chr(10) or Chr(13)

See it this helps.

Maybe html formattingis possible but this works just as fine.
 

3 more replies
Relevance 66.01%

Hello,

I have a list of email addresses that have either:
[email protected]
[email protected]
[email protected]
or no corelation to [email protected]

I'm looking for a macro that will take the emails with dots in them and put the first and last names into cells next to the email. The others I can do by hand. PLEASE HELP!
 

Answer:Solved: Excel Macro to convert email addresses to names

16 more replies
Relevance 65.19%

Although decently experience with excel, I am quite new with VBA and I cannot "record" this macro, so any help writing this in VBA is much appreciated.

1) I need to create a macro that will take a number that is entered into a cell, and upon hitting a button in the excel sheet create an email where the subject line is the number that was in that original cell.

1b)I would like to do this without changing the name of the excel file though, or at least have another macro that resets the file to its original name.

2) Also, if possible, the same macro/vba as above, only with two cells, a number in one and a name in the other, which then shows up as "Number-Name" as the subject line in the email.

Thanks to anyone that can help - Mike
 

Answer:Excel Macro -> email created with field data as subject line

8 more replies
Relevance 65.19%

Hi all,

I need to know if is it possible that a macro in Excel sends an email containing the visible cells using Microsoft Outlook.
btw, I saw some code on the internet, that saves the visible cells in a new excel file and attach it in a new email using Microsoft Outlook, but I don't want to have attachments in the email.

thanks for any possible help.
 

More replies
Relevance 65.19%

Hi all

Looking for some help! Working on an excel document which contains a button I need to send to multiple people, that's fine what I need is for the subject field of the email to take the contents of a particular cell in the workbook and display that. My current code is;
Code:
Sub SendThis_ActiveWorkbook()

Dim Recip()
With ActiveWorkbook

ReDim Preserve Recip(0)
Recip(0) = "[EMAIL="[email protected]"][email protected][/EMAIL]"
ReDim Preserve Recip(1)
Recip(1) = "[EMAIL="[email protected]"]example[/EMAIL][EMAIL="[email protected]"][email protected][/EMAIL]"
.SendMail Recipients:=Recip, _
Subject:="Vacancy Authorisation " & Format(Date, "dd/mmm/yy")
End With

End Sub
Basically I want the subject to be "Vacancy Authorisation [cell contents] 01/01/2000" so I want the contents of a cell to appear in between the date and the "vacancy authorisation" part of the subject line. Assistance appreciated!
 

Answer:Solved: Excel email macro auto-populate subject line

Subject:="Vacancy Authorization " & Range("A1").Value & " " & Format(Date, "dd/mmm/yy")

Regards,
Rollin
 

2 more replies
Relevance 59.04%

I am using the MSN Stock Quote addin with MS Excel 2003. Prior knowledge of this should not be necessary, but I just thought I'd provide full context to my issue. I wrote a macro that essentially records daily stock prices. Because I don't want to store old quotes into perpetuity, i need to ensure that the update quotes button has been hit. I use sendkey() to accomplish this, and then the macro copies the quotes and pastes them elsewhere. My main goal is to have the task scheduler open this file daily so i dont ever have to think about this again, and i'm so close. Essentially my problem is that it takes a few seconds after the update button is hit for the add-in to fetch the new prices from the internet, and this process appears to be delayed until the macro is finished. This is a problem because the macro ends up recording un-updated quotes. I have tried the Application.Wait procedure, and I've tried time consuming loops, do while loops, etc. All of these approaches result in the same thing: Can someone please help me with this? I'm too lazy to hand update this spreadsheet every trading day for the rest of my life (or until i quit). Thank you in advance!
 

Answer:Excel Macro - Allow cells to update query before macro completes

Can't you just put the update macro code in a module of it's own and call it from the main macro?

Regards,
Rollin
 

1 more replies
Relevance 55.35%

Hi, I'm new to this forum (actually forums in general) I was wondering if anyone could help me with a macro code. I work with 4 Excel sheets for my shippments, 2 sets for one plant and 2 for the other but all within the same file.

What I am trying to do is set up a macro that will automatically search for changes within sheet 1 (also for sheet 3, the other plant) When I change the rows color from blank to green/red, I need the macro to automatically cut that whole row and paste it into sheet 2 on the next blank row.

This doesn't seem like it would be that hard to do, but I know know the whole macro language.

If you can answer this please send me an email to soulblazor(@)hotmail.com

Thank you for your help.

More replies
Relevance 54.94%

I am trying to create a code that will autofilter data on an Excel worksheet. The code works fine to filter the data, but it does not hide the AutoFilter Arrows.

Below is the code I am using. What (if anything) is wrong with the code below?
Code:

ActiveSheet.Range("A1:D500").AutoFilter Field:=2, Criteria1:="<>", Visibledropdown:=False
 

Answer:Solved: Excel 2007 Macro -> Hide Excel AutoFilter Arrows

I noticed that the code above (in Post #1) that the AutoFilter Arrows were beinf truned off on Field 2, but none of the others.

I have played around, and done some research to come up with the code below:
Code:

Dim c As Range

For Each c In ActiveSheet.Range("A1:D1")
ActiveSheet.Range("A1:D500").AutoFilter Field:=2, Criteria1:="<>"
c.AutoFilter Field:=c.Column, Visibledropdown:=False
Next

Does anyone have a better solution?
 

1 more replies
Relevance 54.94%

Hi,

I was wondering if anyone could help me. I need to extract data from multiple excel files into a new excel file and sum the values. The data comes from excel files that are made from a template so the data is always in the same place or same cells. For example, i have data saved daily in excel files with the following naming convention 080204, 080304, 080404,..... and so on. What i would like to do is have a macro that will create a week ending sheet by importing and summing the data from that week.

Thanks for reading!
 

Answer:excel macro for copying and pasting data from multiple excel files

thanks for all those who read!!!! let me know if anyone needs the code!
 

1 more replies
Relevance 54.94%

Hello again,

I have a word doc that has a form in it. The form may have any number of fields (boxes) to type text answers into, or be a drop down list to select an answer from. I need an excel macro that extracts all data from the form, but with every five fields starting a new row in excel. So all data from the form will appear within 5 columns in an excel spreadsheet.

field 1 field 2 field 3 field 4 field 5
field 6 field 7 field 8 field 9 field 10
etc

Is that possible? I have had no luck to do it myself.

Sample form attached, thank you
____________________________
 

Answer:Solved: Excel macro to extract Word form data into Excel

7 more replies
Relevance 54.94%

Im using Windows 7 and I used a macro which worked totally fine under Excel 2003. Now, under Excel 2007 it does not run anymore but displays the following error message:

"Run-time error '445':
Object doesn't support this action.

The function of the macro is to open up all other Excel spreadsheets located in the same folder and copy data out of them into the spreadsheet in which the macro is stored.

When I click on "Debug" the Visual Basic Editor highlights the row which says: Set FilSrch = Application.FileSearch

Can you help me with this? I've searched for a solution for a long time but could not find anything which worked.

The following is the start of the macro code:

Sub UpdateTable()
Dim X As Range, I As Integer, J As Integer, RecNo As Integer, CopyVal As Variant
Dim SourceBk As Worksheet, DestBk As Worksheet, StartRow As Integer, IndRange As Range
Dim ServRange As Range, SrcOpen As Boolean, SourceName As String
Dim FilSrch As Object, MyFilArray() As String

'MsgBox "This function not available in this version.", vbInformation, "Function Not Available"
'Exit Sub
'Sheets("LookUp").[a12] = Now
With Application
.ScreenUpdating = False
.StatusBar = "Counting source files ..."
End With
Set FilSrch = Application.FileSearch
With FilSrch
.NewSearch
.LookIn = ActiveWorkbook.Path
.FileType = msoFileTypeExcelWorkbooks
If .Execute > 0 Then
ReDim MyFilArray(.FoundFiles.Count)
For I = 1 ... Read more

Answer:Solved: Excel 2003 Macro Doesn't Run in Excel 2007 - Help Requested

7 more replies
Relevance 54.94%

Hello,

I need help to create an Excel macro that would

1. ask users to select x number of rows to be copied from one worksheet of one Excel file
2. once users have selected the rows to be copied, then the rows are copied from the one original Excel file into X number of target Excel files

Notes:
the target Excel files are all based on the same template
there is one worksheet in each of the target Excel files

in the target files, the rows should be copied from the first available empty row, going down

Looking forward to your help!

Thanks a lot.
Mzz
 

Answer:Macro needed to copy x number of rows from one Excel file into a batch of Excel files

Hi, welcome to the board.
Not much info there to get the correct picture.
Sample? Of source and template please
And not to forget, what version of Excel are you and the users using?
 

1 more replies
Relevance 54.53%

I'm working on a Bill of Material creation automation project that requires some expertise in VBA, and I have none.
The objective is to run a macro from an excel spreadsheet called "PGE BOM", to do the following:
1) Go to the folder "C:\Documents and Settings\Desktop\Auto Project"
2) Find all the .mdb databases in this folder
3) Find "HistoricalMaterialItemsAll" table in EACH of those databases in step 2, and import the data from the columns listed below into PGE BOM.xls's columns C through G:
DrawingNumber
ItemNumber
Quantity
PgeCode
Description
The following is a VBA code that my friend had written in Excel 2007. Unfortunately I have an older version (2000) and the code does not seem to be compatible with Excel 2000.
Sub ImportAccessData()
Stop
dPath = "C:\Documents and Settings\Desktop\Auto Project\"
sFile = "*.MDB"
strSrch = dPath & sFile
Set TargetWB = Application.ActiveWorkbook
Set TargetWS = TargetWB.ActiveSheet
sRow = 2
bFile = False
If Dir(strSrch) <> "" Then
strFlNm = Dir(strSrch)
bFile = True
End If
Do Until bFile = False
strPath = dPath & strFlNm
Call GetData(strPath)
strFlNm = Dir
If strFlNm = "" Then bFile = False
Loop
End Sub
Sub GetData(fl)
Stop
strSQL = "Select HistoricalMaterialItemsAll.* From HistoricalMaterialItemsAll"
Workbooks.OpenDatabase fl, strSQL, xlCmdTable
Set WB = Application.ActiveWorkbook
Set WS = Applicatio... Read more

Answer:Excel Macro - VBA code to import access data to excel

Hello, and welcome to the board!

When posting code, please use CODE tags, which extremely helps with readability.

Perhaps you could try using the code constant???...
Code:

Option Explicit

Sub ImportAccessData()
Dim dPath As String, sFile As String, strSrch As String
Dim TargetWB As Workbook, TargetWS As Worksheet
Dim sRow As Long, bFile As Boolean, strFlNm As String, strPath As String
dPath = "C:\Documents and Settings\Desktop\Auto Project\"
sFile = "*.MDB"
strSrch = dPath & sFile
sRow = 2
bFile = False
Set TargetWB = Application.ActiveWorkbook
Set TargetWS = TargetWB.ActiveSheet
If Dir(strSrch) <> "" Then
strFlNm = Dir(strSrch)
bFile = True
End If
Do Until bFile = False
strPath = dPath & strFlNm
Call GetData(strPath, TargetWB, TargetWS)
strFlNm = Dir()
If strFlNm = "" Then bFile = False
Loop
End Sub

Sub GetData(fl As String, WB As Workbook, ws As Worksheet)
Dim strSQL As String, iRow As Long, sRow As Long
strSQL = "SELECT HistoricalMaterialItemsAll.* FROM HistoricalMaterialItemsAll"
Workbooks.OpenDatabase fl, strSQL, 3 'xlCmdTable
iRow = 2
Do Until ws.Cells(iRow, 1) = ""
ws.Cells(sRow, 7) = ws.Cells(iRow, 5) 'Get the Description
iRow = iRow + 1
sRow = sRow + 1
Loop
Application.DisplayAlerts = False
WB.... Read more

1 more replies
Relevance 54.53%

Hi,
I want to merge two excel files into a 3rd one.

The data are in the files Book1, Book2 and the result in Book3.

I know that i can use VLookup to do the above. But what i have pasted is just an example. The real excel files contains about 9 columns with at many repeating row!!!

Any help will be much appreciated.
Thx
 

Answer:Excel - macro to merge 2 excel files using a common column

Hi welcome to the board. How are you going to treat the duble items, If you want to merge 2 files adn duplication occurs here must be one cell whihc is common to let's say Book1 and Book2.

Do you have a common value? Index? Whatever you call it?
 

3 more replies
Relevance 54.12%

Hi guys,

I have been on the lookout for a macro that will compare 2 worksheets within MS Excel and output the differences on a third sheet.

I am being directed to the URL below but cannot for the life of me work out how to implement this:

http://exceltip.com/st/Compare_two_worksheets_using_VBA_in_Microsoft_Excel/477.html

There are two snippets of code which I will include here for convenience but not sure whether these should be pasted into Workbook Code (i.e. right-clicking Excel icon left of "File" - top-left), Worksheet Code (i.e. right-clicking worksheet tab) or inserting a new Module - or some other method. Is there anyone here that could guide me to how to implement this code?

Quote from webpage - "With the macro below it is possible to compare the content of two worksheets.
The result is displayed in a new workbook listing all cell differences. "

Code:
Sub CompareWorksheets(ws1 As Worksheet, ws2 As Worksheet)
Dim r As Long, c As Integer
Dim lr1 As Long, lr2 As Long, lc1 As Integer, lc2 As Integer
Dim maxR As Long, maxC As Integer, cf1 As String, cf2 As String
Dim rptWB As Workbook, DiffCount As Long
Application.ScreenUpdating = False
Application.StatusBar = "Creating the report..."
Set rptWB = Workbooks.Add
Application.DisplayAlerts = False
While Worksheets.Count > 1
Worksheets(2).Delete
Wend
Application.DisplayAlerts = True
With ws1.UsedRange
lr1 = .Rows.Count
lc1 = .Column... Read more

Answer:Solved: How to use this Macro in MS Excel (compare excel worksheets)

Apologies... I have sorted this... For those that might be looking at this for help here's what I missed:

These are both Sub's that should be created as a Module - both in the same module. I am just comparing worksheets within the Active Worksheet so just removed:

' compare two different worksheets in two different workbooks
CompareWorksheets ActiveWorkbook.Worksheets("Sheet1"), _
Workbooks("WorkBookName.xls").Worksheets("Sheet2")
Click to expand...

I was then able to run this from Macro's. All sorted.

Apologies again
 

1 more replies
Relevance 54.12%

I used a macro which worked totally fine under Excel 2003. Now, under Excel 2007 it does not run anymore but displays the following error message:"Run-time error '445':Object doesn't support this action.The function of the macro is to open up all other Excel spreadsheets located in the same folder and copy data out of them into the spreadsheet in which the macro is stored.When I click on "Debug" the Visual Basic Editor highlights the row which says: Set FilSrch = Application.FileSearchCan you help me with this? I've searched for a solution for a long time but could not find anything which worked.The following is the start of the macro code:Sub UpdateTable()Dim X As Range, I As Integer, J As Integer, RecNo As Integer, CopyVal As VariantDim SourceBk As Worksheet, DestBk As Worksheet, StartRow As Integer, IndRange As RangeDim ServRange As Range, SrcOpen As Boolean, SourceName As StringDim FilSrch As Object, MyFilArray() As String'MsgBox "This function not available in this version.", vbInformation, "Function Not Available"'Exit Sub'Sheets("LookUp").[a12] = NowWith Application .ScreenUpdating = False .StatusBar = "Counting source files ..."End WithSet FilSrch = Application.FileSearchWith FilSrch .NewSearch .LookIn = ActiveWorkbook.Path .FileType = msoFileTypeExcelWorkbooks If .Execute > 0 Then ReDim MyFilArray(.FoundFiles.Count) For I = 1 To .FoundFiles.Count If .FoundFiles(I) <> ActiveWorkbook.Path & "\" & ActiveWorkbook.Name Then ... Read more

Answer:Excel 2003 Macro doesn't run under Excel 2007

As far as I know, Application.FileSearch is not available in 2007. Searching for filesearch replacement turns up lots of hits with various workarounds, such as this:http://groups.google.com/group/micr...Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

2 more replies
Relevance 54.12%

Does anyone know how to run Excel 2003 print macro on Excel 2007 or higher? When I tried running my 2003 macro, the VBA editor pops up w dialogue box, " Run-time error '1004': Method 'ActivePrinter' of object'_Application' failed ".

This is my code: Application.ActivePrinter = "Epson LQ-300 ESC/P 2 on USB003"

Can anyone help?

Thanks!
 

Answer:How to run Excel 2003 print macro on Excel 2007?

Welcome to TSG hope we can help you and you can help others.

I'm not an Excel macro guy but you code looks reasonable. What happens if you run this. I suspect printer name is a little off.

MsgBox "The name of the active printer is " & Application.ActivePrinter
 

1 more replies
Relevance 54.12%

Hi, I have created an excel macro that runs sensitivities in my model. The excel button runs 5 different cases.

The macro runs fine and does as I want it to.

Once the macro has run, and I go to edit a cell and hit "F2" excel crashes. This only seems to happen in certain cells and not all of the time.

Does anyone have experience with similar questions?

Thanks
 

Answer:Excel Macro runs fine..then excel crashes

11 more replies
Relevance 54.12%

With due respect and credit to DerbyDad03 whose earlier post gave me the code below; is there any way to have the new worksheets created from a variable length field e.g. a persons name in a list or a field of fixed length other than a date as the script below uses?Sub CreateMonthlySheets()Dim lastRow, mMonth, tstDate1, tstDate2, shtName, nxtRowOn Error Resume Next'Turn off ScreenUpdatingApplication.ScreenUpdating = False'Make a copy of the data sheet and sort by date Sheets("Sheet1").Copy After:=Sheets(1) Sheets(2).Name = "SortTemp" With Sheets("SortTemp") lastRow = .Cells(Rows.Count, 1).End(xlUp).Row Rows("2:" & lastRow).Sort Key1:=Range("A2"), Order1:=xlAscending 'Using SortTemp Sheet, create monthly sheets by'testing Month and Year values in Column A'Loop through dates For Each mMonth In .Range("A2:A" & lastRow) tstDate1 = Month(mMonth) & Year(mMonth) tstDate2 = Month(mMonth.Offset(-1, 0)) & Year(mMonth.Offset(-1, 0)) 'If Month and Year are different than cell above, create new sheet If tstDate1 <> tstDate2 Then ActiveWorkbook.Sheets.Add After:=Worksheets(Worksheets.Count) 'Name the sheet based on the Month and Year ActiveSheet.Name = MonthName(Month(mMonth)) & " " & Year(mMonth)'Copy Column Widths and Header Row .Rows(1).Copy ActiveSheet.Rows(1).PasteSpecial Paste:=8 'ColumnWidth ActiveSheet.Rows(1).PasteSpecial 'Data... Read more

Answer:Excel Macro to create new worksheet in Excel 2010

I created a quick macro to help you out. This macro creates a new sheet and names it using the contents of cell "A1".Sub CreateNewSheet()
Dim NewSheet
Dim SheetName As String

SheetName = Worksheets("Sheet1").Cells(1, "A").Value
Set NewSheet = Sheets.Add(After:=Sheets(Worksheets.Count), Count:=1, Type:=xlWorksheet)
NewSheet.Name = SheetName

End Sub
Law if Logical Argument: Anything is possible if you don't know what you're talking about.

4 more replies
Relevance 54.12%

I run a weekly excel 2007 macro that converts a spreadsheet to a Word document, but it stops after row 29 of data. Any spreadsheet with 29 rows or less works fine. If I have 34 rows of data, the macro hangs. See below for script. Any help would be appreciated.

Public Sub AddControls(WrdApp As Word.Application, CurRow As Integer)
Dim OptChecked As Boolean
Dim GrpName As String
GrpName = "Grp" & CurRow
'Calculate the colors based on the cell information.
CurRange = "F" & CurRow & ".." & "F" & CurRow
Range(CurRange).Select

If InStr(1, UCase(ActiveCell.Text), "X SRM") > 0 Then 'SRM
OptChecked = True
Else
OptChecked = False
End If

SetCellBG WrdApp, True
WrdApp.Selection.TypeText Text:="Governance:" & vbCrLf

Set RadioObj = WrdApp.Selection.InlineShapes.AddOLEControl("Forms.OptionButton.1")
With RadioObj.OLEFormat.Object
.GroupName = GrpName
.Caption = "SRM"
.Font.Name = "Arial"
.Font.Size = 8
.Value = OptChecked
End With

If InStr(1, UCase(ActiveCell.Text), "X PPO") > 0 Then ' PPO
OptChecked = True
Else
OptChecked = False
End If

WrdApp.Selection.Collapse Direction:=wdCollapseEnd
WrdApp.Selection.TypeParagraph

Set RadioObj = WrdApp.Selection.InlineShapes.AddOLEControl("Forms.OptionButton.1")
With RadioObj.OLEFormat.Object
.GroupName = GrpName
.Caption = "PPO"
.Font.Name = "Arial"
.Font.Size = 8
.Value = O... Read more

Answer:Excel Macro - converting excel to word doc - stops after row 29

13 more replies
Relevance 53.71%

I have a word document that includes a form the user must fill in. I want to create a button that will do all of the following:
1. Update all fields
2. Attach the updated word document to an email
3. Enter an address I have stored in the macro into the To field of the email.

I have one module which does the first part:
Sub CommandButton1_Click()
Dim oStory As Range
For Each oStory In ActiveDocument.StoryRanges
oStory.Fields.Update
If oStory.StoryType <> wdMainTextStory Then
While Not (oStory.NextStoryRange Is Nothing)
Set oStory = oStory.NextStoryRange
oStory.Fields.Update
Wend
End If
Next oStory
Set oStory = Nothing
End Sub

I found that if I add this to the before End Sub it attaches the updated Word document to an email:
Application.Options.SendMailAttach = True 'Or False
ActiveDocument.SendMail

However, I can't figure out how have it put a specific address into the To field of the document.

So I tried another tact. I have the email address as a hyperlink in the document, and set a bookmark at the hyperlink. Then I created a module that will go to the bookmark and open the hyperlink. However, this will not add the document as an attachment:

Sub Open_Hyperlink()
Selection.GoTo What:=wdGoToBookmark, Name:="hyperlink"
With ActiveDocument.Bookmarks
.DefaultSorting = wdSortByName
.ShowHidden = False
End With

Selection.Range.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
End Sub

So then I found this bit of coding on the web, and tried imp... Read more

Answer:Word Macro to attach doc to email, then send address email

I found a solution, but I think it is a bit bulky. It seems to work but I'd love to know if there is a simpler solution:
Sub CommandButton1_Click()
Dim oStory As Range
For Each oStory In ActiveDocument.StoryRanges
oStory.Fields.Update
If oStory.StoryType <> wdMainTextStory Then
While Not (oStory.NextStoryRange Is Nothing)
Set oStory = oStory.NextStoryRange
oStory.Fields.Update
Wend
End If
Next oStory
Set oStory = Nothing

ActiveDocument.Save

MsgBox "Thank you. Your order has been sent", vbOKOnly, "Thank you. Your order has been sent"
Dim bStarted As Boolean
Dim oOutlookApp As Outlook.Application
Dim oItem As Outlook.MailItem
On Error Resume Next
If Len(ActiveDocument.Path) = 0 Then 'Document has not been saved
ActiveDocument.Save 'so save it
End If
Set oOutlookApp = GetObject(, "Outlook.Application")
If Err <> 0 Then 'Outlook isn't running
Set oOutlookApp = CreateObject("Outlook.Application")
bStarted = True
End If

Set oItem = oOutlookApp.CreateItem(olMailItem)
With oItem
.To = "[email protected]"
.Subject = "Promo Order" '
.Body = "Thank you for your order"
.Attachments.Add Source:=ActiveDocument.FullName, Type:=olByValue
.Send
'**********************************

End With
If bStarted Then 'If the macro started Outlook, stop it again.
oOutlookApp.Quit
End If
Set oItem = Nothing
Set oOutlookApp = Nothing
End Sub
 

1 more replies
Relevance 53.71%

Hello, I'm just joined and am trying to create a macro that will automatically email an entire workbook to a list of individuals. I also want the macro to copy and paste a range of cells within a specific sheet in the workbook and paste it into the body of the email. I am able to email the workbook but can't figure out the second part. Any help would be appreciated.

I am using Excell 2007 and LotusNotes 8.5.1
 

Answer:Macro to email centain range in body of email as well as the whole workbook

Hi, welcome to the forum.
There are several posts where I added some simple tips and tricks.
Do you have the macro you use now to mail the whole workbook?
If I see how you have done this then maybe it's a cinch to add the extra info
You may also post a workbook with fictious data if you wish
 

1 more replies
Relevance 53.3%

I have an equation that I need help with putting into an excel Macro. The equation is as follows:
=IF(AND(ISBLANK(E2),ISNA(F2)),"XXXXXX",IF(AND(ISBLANK(E2),ISNUMBER(F2)),"ASSIGN LAN ID",IF(AND(E2="XXXXXX",ISNUMBER(F2)),"ASSIGN LAN ID",IF(AND(E2="XXXXXX",ISNA(F2)),E2,IF(AND(OR(ISBLANK(E2)="FALSE",E2<>"000000",E2<>"111111",E2<>"999999",E2<>"IOIOIO",E2<>"XXXXXX"),OR(ISNUMBER(F2),ISNA(F2))),E2,"No Criteria Met")))))

I need this put into a macro as either an if then else statement or a case statement. If anyone could help me out i would appreciate it
 

Answer:Excel Equation converted to an excel macro

Not sure if this will work for you or not, untested...
Code:
dim e as range, f as range, c as range
set e = range("E2"): set f = range("F2"): set c = activecell
if e = "" and worksheetfunction.isna(f) then
c.value = "XXXXXX"
elseif e = "" and isnumeric(f.value) then
c.value = "AS SIGN LAN ID"
elseif e = "XXXXXX" and isnumeric(f.value) then
c.value = "ASSIGN LAN ID"
elseif e = "XXXXXX" and worksheetfunction.isna(f) then
c.value = e.value
elseif (e <> "" or e <> "0000 00" or e <> "111111" or e <> "999999" or e <> "IOIOIO" or e <> "XXXXXX") and (isnumeric(f) or worksheetfunction.isna(f)) then
c.value = e.value
else
c.value = "No Criteria Met"
end if
HTH
 

3 more replies
Relevance 53.3%

Does anyone know the best way to setup a Macro in Excel 2007 that will work in Excel 2003 as well?

I have an Excel 2007 workbook that I am using a macro to change the "Fill Color" and "Font Color" of cells. However, I will get everything working in Excel 2007, but when I open the workook in Excel 2003 I get many debug errors.

If I change the code in Excel 2003, and then re-open in Excel 2007 I get debug errors.

There must be a way to setup teh workbook to work on both Excel 2007 & 2003.
 

More replies
Relevance 53.3%

Excel '07 won't open an "excel 4.0" macro (i.e. *.xlm file). I am one of a few users at work using excel 2007, I believe this file was made with excel 2000 or similar. When I had excel 2000 it opened fine, it's a common file on the network that everyone should be able to access, and everyone with excel 2000 can easily. So I know it's not the file. When I try and open it with excel 2007 I get that stupid error about the file being different to the extension.

I've tried registry edits and workarounds after scowering the net but nothing seems to fix it. All it does is display the error, then opens excel in the background without even a new worksheet. Excel isn't hanging, it just does nothing. Any ideas?
 

Answer:excel 2007 won't open excel 4.0 macro

XLM was long ago replaced by VBA (with Excel 5 in 1993) and MS no longer really supports it (although I think they claim that they do, kinda, sorta.) So the only thing you can do, I think, is to make a copy of the xlm file and convert the xlm code in the copied file to VBA. Fortunately, I found a link that tells you how to do that:
http://blogs.msdn.com/b/excel/archive/2010/02/16/migrating-excel-4-macros-to-vba.aspx
(Look at the link at the bottom, too. But you will need to download that to an older PC, possibly.)
Now, assuming all goes well, this will give you two versions of the same file, but if everyone else has Excel 2000 (or later) then they will all be able to use the new VBA-based file, so you won't end up with two files that would lead to confusion.
Still, it looks to be a lot of work, so good luck!

On a final note, if you need this file done in VBA and you can't figure out how to redo it, make a post describing your needs - there are some amazing VBA coders on here.
 

1 more replies
Relevance 53.3%

A macro I wrote in VBA for Excel 2004 won't run in Excel 2011 (alas...). Upon opening the spreadsheet an "on open" routine runs, and bombs out on the following command:
Code:
Set cmdbar = Application.CommandBars.Add _
(Name:="Sort", _
Position:=msoBarTop, _
MenuBar:=False, _
temporary:=True) 'msobartop docks the menu at the top

Does anyone know if the VBA structure ("CommandBars.Add") has been removed or altered?

Is there another way to accomplish the same thing in 2011? I want to create a custom command bar (I populate it later in the module).
 

More replies
Relevance 52.07%

Dear Guyz

I have a macro helped and developed by a respected admin of this group

it has following statement

If Cells(lRow, "N").Value >= 5 And Len(Trim(Cells(lRow, "P").Value)) > 0 Then ' check if the months passed are >= 5 (same as the red conditional formatting)
If Len(Trim(Cells(lRow, "O").Value)) = 0 Or (IsDate(Cells(lRow, "O").Value) = True And Month(Cells(lRow, "O").Value) <> Month(Date)) Then
toList = Cells(lRow, "P") 'gets the recipient's email address Column O

I want to add another line from another macro

If cell.Value Like "?*@?*.?*" And _
LCase(Cells(cell.Row, "C").Value) = "yes" Then

which makes sure that only @ emails are there and also ensures to which person it has to email and which it has avoid.

Can anybody help me to sort out this especially @Keebellah
 

Answer:Yes for Email No for no Email Condition in an if Statement of macro

7 more replies
Relevance 49.2%
Question: Excel Macro help

Hi, I've had great success with this form before and was looking for some more help on an Excel spread sheet. I've created a macro that inputs data onto a separate sheet, entered from a template sheet. The macro executes using a button and i was wondering if there was a line of code that could bring the input cell back to the first entry position, after the button in clicked and the inputs are erased. I've attached the input section of my program if anyone would like to look at it. Thanks for any help.
 

Answer:Excel Macro help

After which button is clicked? (you have 3)

Regardless, just add Range("C2").Select at the end of the code.

And while you're at it, replace:

Range("C2:C3:C4:C5:C6:C7:C8").ClearContents

with:

Range("C2:C8").ClearContents

HTH
 

2 more replies
Relevance 49.2%
Question: Excel Macro Help

I have a large data row set to work with, I want to be able to add new data rows every week.

I have been trying to create a macro that allows me to paste my new data rows (either above or below) the existing data.
The main problem I am having is when trying to code/record my macro it automatically pastes it in exact location I click on e.g b4.

I want the pasted data rows to appear either underneath or above the existing data rows, regardless of how many data rows there already are. (as i will be constantly adding new ones, therefore the number of rows in the sheet will rise continuously)

I have tried to use the "Insert Copied Cells" function, but I am finding that my macro does not recognise this...

Any ideas/guidance will be greatly appreciated
 

Answer:Excel Macro Help

Hi there, welcome to the board!

While I'm not sure what you're looking for exactly, you can find the last cell either by looking at the bottom of a column, up, or by using the Find method. The downside of looking at one specific column is if you have uneven columns (usually this doesn't happen, but possible). Here are examples of both...
Code:
Option Explicit

Const NL As String = vbNewLine

Dim WS As Worksheet
Dim rLastCell As Range
Dim iLastRow As Long
Dim iLastCol As Long

Sub FindLastCellColA()

Set WS = ActiveSheet

'/// As a (long) numeric row
iLastRow = WS.Cells(WS.Rows.Count, "A").End(xlUp).Row

'/// As a range object
Set rLastCell = WS.Cells(WS.Rows.Count, "A").End(xlUp)

MsgBox "Column A only" & NL & NL & "Long type: " & WS.Cells(iLastRow, "A").Address(0, 0) & NL & "Range type: " & rLastCell.Address(0, 0)

End Sub

Sub FindLastCellInSheet()

Set WS = ActiveSheet

'/// As a (long) numeric row & column
iLastRow = WS.Cells.Find(What:="*", After:=WS.Cells(1, 1), LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
iLastCol = WS.Cells.Find(What:="*", After:=WS.Cells(1, 1), LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Column

MsgBox "Entire sheet&quo... Read more

3 more replies
Relevance 49.2%
Question: Excel Macro Help

Here is a snippet of my code....
Code:

If ActiveCell.Column = 3 Then
FileName = Target & ".m4v"
FilePath = m & ":\Movies\" & Range("C1")
RetVal = ShellExecute(0&, "open", FileName, vbNullString, FilePath, 1&)
Application.Quit

What I would like to figure out is....if the shellexecute does not open the file due to the file extension is not correct, open the same file with different extension.

Can this be done?
 

Answer:Excel Macro Help

6 more replies
Relevance 49.2%
Question: HELP Excel macro

I have two spreadsheets, one with company name listed in column A and the other with company name (column A) and postcode (column B). I simply want to be able to add the postcode into column B in my first sheet. I cant simply copy them over as there are different number of records.

I guess this is quite a simple matching exercise and if anyone knows a macro to do it I would be mightily grateful.

Tx
 

Answer:HELP Excel macro

I don't think you need macro to do this. Function VLOOKUP should do fine, try it.

Jimmy
 

1 more replies
Relevance 49.2%
Question: Excel Macro Help

Howdy all. Attached is a mock-up of a workbook I'm trying to assist someone with. It should be a pretty simple macro; we want to take only the negative numbers (in red) in col E and move them to col F; the only caveat is I need the rest of the data in each particular line to stay static.

I will be offline this weekend, but back early AM Monday. The person whom I am assisting may pop in and be able to answer questions over the weekend as well, but that is not confirmed.

Thanks in advance,

v
 

Answer:Excel Macro Help

7 more replies
Relevance 49.2%
Question: Excel Macro help

Hi guys, i was wondering if you could help.

I simply cannot get my macro working,

I need the macro to take the value from a cell, e.g. "D9" and search for it in a data set which is in A5 to A9, once found it then needs to offset by two collums and enter a number 1 into the column.

I know this sounds simple, but i have given up hope

Please help

Thanks in advance

Jon3sey
 

Answer:Excel Macro help

6 more replies
Relevance 49.2%
Question: excel and macro

I am new to macros. I want my excel sheet to populate a ready-made word doc by putting in the data from the cell I click on, and no more than that.
Anyone help an absolute beginner to this stuff?
 

Answer:excel and macro

moved to business applications forum
 

2 more replies
Relevance 49.2%
Question: Excel macro

Hey all,

just made an excel macro and when i run it the worksheet turns blue and the row/column headings turn black and nothing happens. Any suggestions?

thanks
shiva d
 

Answer:Excel macro

8 more replies
Relevance 49.2%
Question: Excel Macro Help

I don't know anything about visual basic, and have no programming experience, but am skilled with computers in general.

Would someone please help me with a Macro for Excel?

All I want is for it to send an email with an attachment (same email address, same attachment) every Monday-Saturday at 10:00 PM

Thanks!

(My email is [email protected])
 

Answer:Excel Macro Help

10 more replies
Relevance 49.2%

Hello,

Can someone please help? I need a way to be able to find and replace in Excel on a mass scale. I have two colums A & B. I want to be able to find the value from Column A and replace it with the value in the same row in column B. The values are diferent sizes.

Thank You
 

Answer:VBA Excel Macro Help

Welcome to the forum microfire.

Can you provide a sample of dummy data, with a little more info - perhaps a before and after of what you want achieved.
 

1 more replies
Relevance 49.2%
Question: Excel VBA/Macro

I am trying to design an automated shopping list for Housebound elderly and disabled persons.

In Excel I have a shopping list that is multiple worksheets with one column and then with different categories for each worksheet. Ie. Produce, Dairy, Meat, Baking, Staples, Canned, Frozen, Cereals and so on

To use it I want to use VBA or a Macro to Turn the Filter on, let the user select the items wanted from the list. Copy the filtered list to the WorkSheet "ShoppingList" then go to the next work sheet and again turn on the filter and select the items the client wants on the shopping list then copy the filtered results to Column B of WorkSheet "ShoppingList". I want to do this for all the worksheets. Produce, Dairy, Meat, Baking, Staples, Canned Goods, Frozen Foods, Cereals, and so on.

When I try to make a macro it records the items selected when the filter is turned on. I need the macro to pause at that point while the individual items on the list are selected and then continue once ok is pressed.

Any one know how to edit the macro to make it work correctly?
 

Answer:Excel VBA/Macro

16 more replies
Relevance 49.2%
Question: Excel macro

Hi all you excel professionals. I'm still a rookie but I'm slowly getting there. I wonder if the follwing is possible. I'l be very brief. In column A, form cell A1 to A500, I have typed in 0011, 002, 003 , etc up to 00500. In column B, from cell B1 to B500 I have typed the word "total". Now I want to put the word total into Cells A1 to A500. For example, cell A1 would now read 001 Total and cell A2 would now read 002 Total etc all the way to cell A500. I have tried to merge the two cells but I loose the word Total. Is there a macro that will do this? If so can someone out there do it for me?

Please help me.
 

Answer:Excel macro

6 more replies
Relevance 49.2%
Question: Excel macro

Excel macro

A friend has a spread sheet he receives every week. He has to copy info from that sheet and past it into a new Excel sheet in a different order and then save the new sheet as a "prn" file.

He wants to create a macro (or two) that will do as much of the following as possible.

The following cells are always the same.

He wants to copy the following cells and then paste each cell area below the previously pasted cell area with one blank cell between each cell area.

The "pasted" info is then saved as a "prn" file.

Here's the cell info he's coping.

D7-F18
D21-F32
H7-J18
H21-J32
L7-N18
L21-N32

I can create a macro but this is out of my league.
Questions? Solutions?
 

Answer:Excel macro

7 more replies
Relevance 49.2%
Question: Excel Macro

I have values entered in the C column that look like the following

'MAK, REP'

I need to find a way to make the values like the following:

'MAK','REP'

Any suggestions would be very much appreciated.
 

Answer:Excel Macro

14 more replies
Relevance 49.2%

Hey everyone,
i need some help with vb/macro in excel
i got two integers, lets say Value1 and Value2.
Value1 = 2
Value2 = 4.
i want the macro to goto a cell where the column is Value1 and the row is Value2.

is it possible?
 

Answer:Excel VB/Macro help

7 more replies
Relevance 49.2%
Question: excel macro

i have a simple macro to update a file by copy and pasting
i would like the macro to execute every 7 hours can this be done
 

Answer:excel macro

Moved you to Buisness, where you may get more replies
 

1 more replies
Relevance 49.2%

Hello.... I am trying to prepare some reports for my boss and I am stuck on the macro I am writing. somehow I need to put the date in as a variable. you know hte same way that excel has the today() formula but I don't know what the code for that is. Can anyone tell me how to state that the variable TDay is equal to the current day so that tomorrow it will be automatically equal to tomorrows date?

Thanks

 

Answer:Help With Excel Macro... Please....!!

Tday = date

does this work for you?
 

3 more replies
Relevance 49.2%
Question: excel macro

how to extract multiple excel files contents into one excel files , that all excel files are in one directory with directory reference plz anybody help, i need macro code
 

More replies
Relevance 49.2%
Question: Excel Macro Help

Hello All,

I am using Access 97 to generate a database. After entering data into forms in Access, the user then clicks a button which opens a report in excel. I have created a macro in excel which should automatically maximize the worksheet in excel. This macro also changes the active worksheet to "sheet2". The part of the macro which changes the active worksheet is working fine when I load the report through access, but not the part of the macro associated with the maximization of the window. Both parts of the macro work if I open excel on its own (ie: not through access). Below is my code:

Sub auto_open()

Worksheets("Sheet2").Activate
ActiveWindow.WindowState = xlMaximized

End Sub


Any suggestions?

Thanks in advance for your help.

engineer_in_training
 

More replies
Relevance 49.2%
Question: Excel macro

hi.

I have an excel sheet with many rows and columns. the headings for the columns contain an expiry date, who the agreement is with (hyperlinked to a pdf), type of agreement, time until expiry and type (7 different types). I need a macro that will -
search each row and look for when 'time until expiry' = "less that 2 months" and 'type' = (one of the seven)
then send an email to a person whose email is in a different cell off to one side of the worksheet.

After it has done this, i need to run another macro which checks the same thing but with a different type (and email address)

Once all this is done, i need a macro to do all of the above but with "7 days" as the 'time until expiry'.

I also need a macro to run and search the rows for "unsigned" in the comments and again go through each type and send an email to the respective person.

Can this be done?!?!? It would be great if the macro could run automatically when the workbook is open.

Thanks so much in advance!!!
 

Answer:Excel macro

welcome to TSG, jenrowlands
while this is indeed a "do it yourself" problem, we have a forum much better suited to a business application problem....it's called "business applications

i'm moving your thread there.
 

3 more replies
Relevance 49.2%
Question: Excel Macro

I have turned on the Macro to automatically update a spreadsheet every time it is opened. I need to be able to stop this so I can save a copy and add notes to this worksheet. How do I disable this macro? Even when I save it as another name, when I open it next time is updates the data.

I am using Excel 2000.

Thanks
Nancy
 

Answer:Excel Macro

Generally, holding the shift key while opening an Excel file that contains workbook_open or auto_open macros should disable it from running until you close and open again, this time without using the shift key.
 

3 more replies
Relevance 49.2%
Question: Excel Macro

I am fairly new to building macros and have been able to build some fairly simple ones, but I need help with this new one. I have an excel sheet with two columns that goes down several rows with two unique numbers and a separate sheet with two boxes that will create a chart when the two numbers are put into the boxes. I need a macro to grab the two numbers in each row, put them into the two specific cells while moving it to a a new sheet and continue down the rows until a chart has been built for each row. Thanks ahead of time for your help.
 

Answer:Excel Macro

MarinoFan,

I'd like to help with this but I'm confused by your description. How will the macro know which two cells to fill with data on the second sheet? Is there a separate chart for each pair of numbers or is this all one big chart? If they are different ones, is each one on a different sheet?

Cheers.
 

3 more replies
Relevance 49.2%

Hi,

I'm going around in circles and can't seem to find an approach that lets me accomplish what I need to do... Any help very much appreciated!

I have a folder full of customer purchase history CSV files (about 1500). I need to import these into the new accounts package and so need to copy the data from the original CSV to a new one with all the original columns of data mapped to new locations on the new master spreadsheet.

At the moment I have written two very basic macros. I have to open the file, run macro 1, close the file and move it to trash, then go to Book2 (the new master spreadsheet) and run the second macro before opening the next file and repeating the procedure.

Trouble is having to do it manually and also it overwrites the data from the last file with my current novice scripts.

I'm looking for a way to open each file in the folder, run the two macros and then move the completed file to the trash before moving onto the next file in the folder.

I would also like the data from the second file to be entered on the first free line below the previous file's data.

I am fully aware that my current macros are not up to scratch, I thought I was a better swimmer but I now find myself on a deadline and floating in deep water!

It's worth noting that I'm working on Mac.

Many thanks in advance.

Macro1:
Code:
Sub Macro1()
'
' CPH Macro
'
' Keyboard Shortcut: Option+Cmd+e
'
'contact name
ActiveWorkbook.ActiveSheet.Range("A1"... Read more

More replies
Relevance 49.2%
Question: excel macro

Hi,
Everyday, I get a file with a list of items and thier prices.How would i create a macro in EXCEL to automatically copy the same data to four regions. This can be anywhere in the sheet and the item and price need to be in the same columns.For example:
item# price
5555 10.00
6666 20.00
7777 30.00
8888 40.00

I would have to do the same with regions 1,2,3,and 4
item# region price
5555 1 10.00
6666 1 20.00
7777 1 30.00
8888 1 40.00
5555 2 10.00
6666 2 20.00
7777 2 30.00
8888 2 40.00
5555 3 10.00
6666 3 20.00
7777 3 30.00
8888 3 40.00
5555 4 10.00
6666 4 20.00
7777 4 30.00
8888 4 40.00
 

Answer:excel macro

6 more replies
Relevance 49.2%

I am designing a ?basic? database in work and having trouble with some macrosThe database is a record of production. Information is added at pre and post production. Adding the pre-production information I have sorted. A form is filled in, submit button hit and a new row is created with the information in. Along this row there are gaps where post production information is entered, but trying to get this information to paste into the correct row I cant do.I have a form to fill in the information (one each for pre and post production) which I then want adding to the database against the reference number. Converting the information from the input form into the database I can do for pre production, but getting the post-production data entered into the database along the correct row I don?t know how to get there.I believe I want a search function that takes the database reference number (on the post-production form) and finds this in column A. once this ref number is found, the cell is active and I can to paste the information from the post production form into the gaps on the correct row Anyone have a clue?

Answer:help with Excel macro

Can you clarify a point here?  Your title is "help with Excel macro".  Excel is a spreadsheet program, yet you refer to a database over and over and do not once mention a spreadsheet or other terms, such as Workbook or worksheet, which imply Excel.  Macrosoft Access a database and is part of the Pro version of Microsoft Office.  So, are you using Access?  If not, I'm curious why you keep referring to database when you are using Excel, a spreadsheet program.  Or, are you using both for that application you are working with? 

10 more replies
Relevance 49.2%
Question: excel macro

Does anyone know how to make the file name show up in the open portion of the dialog box?

When I use the command:
Application.Dialogs(xlDialogFindFile).Show
The dialog box shows up, but when you browse and find a file, the file name does not show up in the open box below. Although it doesn't cause a problem if you just hit the open button, it caused confussion with a friend of mine.

I found an example on the web for saveas:
Dim ck As Boolean
If newName = "" Then
str1 = "Enter New File Name Here"
Else
str1 = newName
End If
ck = Application.Dialogs(xlDialogSaveAs).Show(str1)
If ck = True Then
newName = ActiveWorkbook.Name
End If

and this one works good, but when I replace the saveas with findfile I get an error. Any suggestions?
Thanks,
Sly
 

Answer:excel macro

6 more replies
Relevance 49.2%
Question: Excel Macro

I have two worksheets within the same workbook. WkSheet "Data" as my source and wksheet "Form" that I need to populate from the source.

I need to be able copy the quantity from my "Data" wksheet along column A, starting with A5 to my "From" wksheet in column A, starting with A9.

I need the quantity from the 'Data" wksheet to be pasted to the next open cell along the column A in my "Form" wksheet.

Can someone please help!!! Thanks.
 

Answer:Excel Macro

Hi, welcome.
A 'picture' tells more that a thousand words, but it's quite simple.

The other thing is; Which version of Excel are you using?
Code:

Sub CopyData2From()
Dim xRow As Long, yRow As Long
xRow = Sheets("Data").Range("A" & Rows.Count).End(xlUp).Row
yRow = Sheets("From").Range("A" & Rows.Count).End(xlUp).Row + 1
Sheets("Data").Range("A5:A" & xRow).Copy
Sheets("From").Range("A" & yRow).PasteSpecial
Application.CutCopyMode = False
End Sub
 

2 more replies
Relevance 49.2%

I'm trying to update (& create) some macros in Excel (for WinXP) and all of a sudden it's using absolute values instead of relative values. Fine, okay, I select the relative value button and try again, but now the macro is skipping a column between each entry, when it should just be going to the next column. I'm at my wit's end and I need to get this fixed NOW. Help!!!!
 

Answer:Excel Macro - Help!

13 more replies
Relevance 49.2%
Question: Macro in excel

I would appreciate help with a macro to separate numbers in a line of text within a cell, and also to change the value of that number,
for example remove the text and keep the number or
remove the text and change the number to another value

Mining & Energy Plate-C3
Ryan & McNulty Sawmilling (68)
Black & Black - Bm65

Thank you
 

Answer:Macro in excel

6 more replies
Relevance 49.2%

Hey guys I am working on a spreadsheet for this cinema thingy at school and I wannaget top marks sooo can any of you tell me or show me how to make a macro to reset certain cells ie B2-B5 by reset i mean change the number to 0 please help I rlly need help i cant write macros lol
 

Answer:Excel macro help please

6 more replies
Relevance 49.2%

I'm trying to create a macro that will copy rows 1 & 2 and paste it in the row containing the last value in column B + 1. The goal is to allow a user to insert a repeatible header throughout a worksheet as needed. Admitedly I'm stumped how to find the last column with a value and move down 1 before the paste.
 

More replies
Relevance 49.2%

OK, I have a simple spreadsheet - 2 tabs (1 with raw data, and 1 for reporting results from the data). For this problem I have 4 columns on the data tab I'm concerned with: Instance, Date of Instance, Time of Instance, and Instance Description. The Instances have about 50 different names. I need the macro to search for a specific instance (call it "Network Fail"), and when this instance is present on the data sheet; record the Date of Instance, Time of Instance, and Instance Description in the appriopate cells on the reporting results tab. I am fairly new at macros, but have a good understanding of excel - can anyone help me please??!!

Answer:Need Excel Macro Help!!!

Is there more than one occurrence of a given "instance" e.g. Network Fail that you need to pull data about?If not, could you simply use VLOOKUP?Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

6 more replies
Relevance 49.2%
Question: Excel Macro

I have two workbooks (Book1.xls and V.xls) that I am trying to match names in Column A of both. When there is a match I need to copy the value from Column I with the corresponding matching row in Column A into Column C of the corresponding matching row and i need to loop this process until Column A in V.xls says DONE in the last cell.
AND I have no idea how to do this but I know it should be fairly simple for smart people.

Please help my fingers hurt from using alt+tab, ctrl C and ctrl V so many times as it is.
 

Answer:Excel Macro

6 more replies
Relevance 49.2%

Need help with some Excel VBA as I am not very good a programming!
I have a long list of records in a single excel spreadsheet and I would like to move a whole row based on the the data content in one of the cells to a new workbook with the cell data as the name of the work book.

bouitac
 

Answer:Excel VBA/Macro Help

16 more replies
Relevance 49.2%
Question: Macro VBA Excel

View attachment Example 1.xls
View attachment Example 2.xls
In the worksheet "example 1" macro "sum columns" sum the columns values, but only if the code is numeric. As I do so that it works on worksheet "example 2" whose alphanumeric codes. Attachment both worksheets.

Thank You
 

Answer:Macro VBA Excel

Feli Nadal

I simplified your code, it's easier to read this way.
 

2 more replies
Relevance 49.2%
Question: Excel macro??

I have a problem in Excel which I assume can be solved with a macro, but I cannot find the right solution.

I want to set up a template with a 4 character code (such as abce or a134) going into a particular cell - say cell b4. I want this then to set up a file in a folder in my documents with the code in cell b4 being the file name. The aim is that I should only have to press Save when the rest of the spreadsheet has been assembled. It is not a big spreadsheet - a single page.

Hope this makes sense.

TIA
 

Answer:Excel macro??

6 more replies
Relevance 49.2%
Question: Excel Macro

I have a CSV file that exports to excel and produces and sorts various pieces of data with some simple macros, what I am then left with is a sheet of information that I need to paste into a MSWord table, the table already has the font and style formats that I need, but because the data is based on the information from the Excel workbook I cannot predict the number of rows needed, although this number is displayed in a single cell in the workbook. When the table has been pasted I would need to be able to rename and save the Word document using a week number, displayed in the workbook as the file name. Is it possible to write a piece of VBA code to handle this?
I should have said I am running office 2002
 

Answer:Excel Macro

8 more replies
Relevance 49.2%

1. Find and select the last column that contains data from worksheet1.2. Copy this entire column to worksheet2.Please help! Thanks!

Answer:Need a VBA Excel macro to do the following:

You will need to play with this but it should give you some ideasSub MyTest() Dim iEndRow As Long, iEndCol As Long iEndRow = Range("B65536").End(xlUp).Row 'find a column that always has data iEndCol = Range("AZ" & iEndRow).End(xlToLeft).Column MsgBox iEndRow & " " & iEndCol Columns(iEndCol).Copy Sheet2.Select Sheet2.Range("A1").PasteSpecial (xlPasteAll) 'change the column to one of your choice End Sub

2 more replies
Relevance 49.2%
Question: Excel Macro help

Few questions we've been having around the office. As the most junior on the programming team I get the short straw with the IT stuff cause our IT guy only comes once every couple of weeks.

Our accounting team has been utilizing more macros in their Excel work (2007) and we're having problems with editing macros. A macro won't work the way they want it to so they'll go to edit or delete it and come back with an error about hidden workbooks.

Did a little research and I think the problem comes from the settings in the workbook itself about having macros visible or enabled for that particular file because when I go to the macro settings and bring up their individual file they're working on the macro list is empty. (This also might by why the macros aren't working the way they want them to.)

So I think I need advice on how to edit macro settings for individual documents. If I haven't identified the problem correctly I would appreciate any information on how to fix my problem.
 

Answer:Excel Macro help

AFAIK, there's isn't really an easy way to edit macro settings for individual files. You can change the security level in Excel to something like low which would enable most macros by default but this isn't typically a recommended practice.

It's also possible that the user has disabled macros from running (i.e. clicked the Disable button at the opening dialog) and then can't edit / run any.

Something else to look at is if the macro has the designation Private. You can check this by opening the code window (ALT-F11) and then double-clicking the various sheets and modules in the left-hand pane. If any of the various modules have Private Sub listed at the top of the subroutine, it won't show up in the macro list (Tools > Macros), but will be available to run, and be available to edit through the code screen.

Also, for hidden workbooks, check under Window > Hide or Window > Unhide.
 

3 more replies
Relevance 49.2%
Question: Excel Macro Help

Hi all,

I've recorded a macro where I switch from one sheet to another to copy something and then switch back to the previous sheet to continue working, so in the macro it's recorded as:

ActiveWindow.TabRatio = 0.473
Sheets("Template").Select
Range("A1:X31").Select
Selection.Copy
Sheets("Sheet1").Select
ActiveWindow.ScrollColumn = 2

Can anyone help me to edit this so that, rather than selecting "Sheet1" again, it just selects the previous sheet, without needing the name of the sheet to be "sheet1" everytime? This way I will be able to run the macro where I jump to "Template" and return back to whatever sheet I was working in originally, whatever the name is. Make sense?

Hope someone can help!

Thanks!
 

Answer:Excel Macro Help

Do you have at least a little vba knowledge?
You can use variables and assign these to the sheet's names
For eample:
Dim ws1 As worksheet
Dim ws2 As worksheet
set ws1 = sheets("Template")
set ws2 = Sheets("Sheet1")

to select one or the other ...
ws1.select
ws2.select

many time you do not have to change sheets, you can address them anf take the data from one and copy it to another

another example:

ws2.Activate
ws1.range("A1:X31").copy
ws.Range("A2").Pastespecial

Play around with this I can't tell you much more becasue I don't know your sheet's layout etc.

I don't undestand the TabRation and the ScrollColumn=2 can be changed too.
 

3 more replies
Relevance 49.2%
Question: Excel Macro

I am using a program called MUST. It is for the electrical transmission industry. It uses excel to do its computations. It runs macros based on the buttons that were pushed on a form. It calls a .xla spreadsheet that has all of these macros. The worksheet is password protected. The outputs are excel based worksheets.

It has a feature to allow you to record the buttons that are pushed in it own .asc file format. If you run the code within this file format it gives you back a text file that is very hard to use. If you try to do the same function more than once it writes over top of the text file. It works while in excel but if you run it in .asc format it overwrites the file.

I would like to be able to record the buttons I press in this form in python so that I can recreate my steps quickly. Everything in this program is password protected, so I can't do a call on button push, because I don't know what the buttons are called. Excel will not record what I do within must.

I am thinking of possibly a program that can record various buttons I push. If possible I would like it to be python based, because that is the main program in my industry. If you have other suggestion, I would greatly appreciate the input.

Any suggestions would be greatly appreciated.
Thanks,
Joe
 

More replies
Relevance 49.2%

Hi

I am trying (without sucess) to write or find a macro that allows me to compare cells in a Excel (2007) spreadsheet.

The macro would work like this

if A1 was the target and A2 was the actual,

If A2 was greater or equal to A1 then A3 would be the differance in green
if A2 was less than 5% of A1 then A3 would be the differance in amber
if A2 was more than 5% of A1 then A3 would be in Red

Practical the result would be this

If the target A1 was 20 and the actual was 30 then A3 would read 10

If the target A1 was 20 and the actual was 19 then A3 would read -1

If the target A1 was 20 and the actual was 15 then A3 would read -5

I hope you understand this and someone can help, I would also need to repeat this for multipical pairs of cells


Please please help

Many Thanks
 

Answer:Excel Macro help please

Hi,

i am new to macros and to forums so forgive me if i am breaking rules or anything here.

i am trying to write a macro that scrolls the page up and to the right on each worksheet in the workbook.

here is what i have so far
Sub PageUp()
'
' PageUp Macro
'

'For Each ws in worksheets (array("sheet2", "sheet1")).SmallScroll ToRight:=15
Range("Z5").Select
ActiveSheet.Shapes.Range(Array("Smiley Face 9")).Select
Selection.OnAction = "PageUp"
Range("Z5").Select

End Sub
Please could somebody advise me on how to do this?

Many Thanks
 

7 more replies
Relevance 49.2%
Question: Excel Macro Help

Good Afternoon,
I was hoping to get help writing a macro that would look at cell A9 and run function GetCellComment('Master Pricing'!R[-6]C[-8]) and paste that into cell I9.

then loop to the next cell (A10 and paste into cell I10) until it encounters an empty cell in column A.

Thanks in advance for your aid.

/frank
 

Answer:Excel Macro Help

8 more replies
Relevance 49.2%
Question: Excel macro Help!!

Hi Guy's
I#m very new to excel programming and I need to create an Excel macro for a small application. I have a drop down list created in Excel and I need to assign a macro for the selected drop down list.

Sheet1: Drop-down list with three Items,
Item1
Item2
Item3

Sheet2:
Col1Row1 (data), Col2Row1 (Item1 --> Actually same Item name as drop down list)
Col1Row2 (data), Col2Row2 (Item2--> Actually same Item name as drop down list)
Col1Row3 (data), Col2Row3 (Item3--> Actually same Item name as drop down list)

In Sheet1 I need to create a macro that,

When I select the Item1 from the drop down list and if it matches with the name in cell Col2Row1 then I need to copy the cell Col1Row1 data into Sheet1.

Simillarly when I select the Item2 from the drop down list and if it matches with the name in cell Col2Row2 then I need to copy the cell Col1Row2 data into Sheet1.

Please help me out!!

Thank You.

-Arun
 

More replies
Relevance 49.2%
Question: Excel Macro

I am using Excel97. I have a twenty column worksheet with a combination of text and numbers. The data will be inputed by numerous sites and then sent to a central site for collation.
I have written a macro to do a specific sort automatically at the individual sites - Using column p (text) as Sort Key 1 and column q as Sort Key 2. Here is the part I cant figure out Column P is a mixture of blank cells and text entries. In order to sort the blank cells first I have the sheet replace the blanks with 1s and then I have it sort column P first and then column Q. But when that is done, I want the macro to ignore all the cells with 1s and switch so that the sort is done on Column Q first. After the first sort, can I then specify a range based on cell contents?
 

Answer:Excel Macro

7 more replies