473,396 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Need help with a macro

I am trying to get my macro to work - and I can't seem to figure out what is wrong. The steps I want it to perform are to duplicate the GL Activity sheet; rename it as the CC integer; then delete the rows which are not the CC integer in the new GL tabs. I know the delete function is the problem - I just don't know what to do. Any help would be appreciated.

Dim i As Integer
Dim j As Integer
Dim Count_CC As Integer
Dim Count_GL As Integer

Count_GL = Worksheets("GL Activity").UsedRange.Rows.Count

Count_CC = Worksheets("cc list").UsedRange.Rows.Count


For i = 1 To Count_CC
Worksheets("GL Activity").Copy after:=Sheets(Worksheets.Count)
ActiveSheet.Name = Worksheets("cc list").Cells(i, 1).Value

For j = 1 To Count_GL
If ActiveSheet.Cells(j, 4).Value <> i Then
ActiveSheet.Cells(j, 4).EntireRow.Delete = True
Else
End If
Next j

Next i

End Sub
Feb 9 '10 #1
0 740

Sign in to post your reply or Sign up for a free account.

Similar topics

21
by: Chris Reedy | last post by:
For everyone - Apologies for the length of this message. If you don't want to look at the long example, you can skip to the end of the message. And for the Python gurus among you, if you can...
4
by: Marc | last post by:
Hi all, I am trying to write an application where I need the ability to open an Excel spreadsheet and do basic read/write, insert rows, and hide/unhide rows. Using win32com I have been able to...
3
by: bob | last post by:
Need help with c macro. Have this call in my c program. stub.c SYMBOL(ALPHA) << no, dont want to change this to any other form. SYMBOL(BETA) Need a macro to expand each of above to this.
5
by: Bill | last post by:
This database has no forms. I am viewing an Access table in datasheet view. I'd like to execute a macro to execute a function (using "runcode"). In the function, I'll reading data from the record...
1
by: moty | last post by:
Do any body have a code example that illustrate the preprocessor of moving #define macro into the code. I need to replace all macro call (#define) in my code (file) with the macro code. ...
6
by: zaheer031 | last post by:
Hi All, I need to define a macro as follows #define VERSION "1.0" #ifdef (VERSION == "1.0") #endif main() { }
0
by: =?Utf-8?B?TGV0emRvXzF0?= | last post by:
I'd like to create a Macro that will sort some raw data, apprx 20k lines, remove some lines based upon a condition in a certain column. Then copy this data into a new spreadsheet and sort the ...
2
by: brokkoli88 | last post by:
Hi! I am having sort of a problem with a school assingnment. I need to create a macro that checks if the content in a cell is a number. If the value is a percentage, I need the macro to check if...
2
by: jotr | last post by:
I recently received help writing a search macro for excel, but now I am trying to change it up to use it in another spreadsheet, and I am having some troubles. I need it to search two cells one has...
1
by: sandyt57 | last post by:
I do Tech Support but do not know Visual Basic programming. In order to resolve a work process issue for one of our depts I need a macro that can do the following. I tried to create a macro in Word...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.