473,398 Members | 2,427 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,398 software developers and data experts.

Loop through the cell and give the anser

PLEASE HELP ME ON BELOW QUERY
I HAVE 5 COLUMNS...
I HAVE SORTED THE DATA FROM SMALLEST TO HIGHEST(code column)...
NOW I WANT TO COMPARE SUBCATEGORY WHETHER 1ST AND 2 ROW DATA IS ARE SAME, IF YES THEN I SHOULD GET RESULT AS TRUE
FOR EXAMPLE GIVEN BELOW
CODE--NAME--DATE--CATEGORY--SUBCATEGORY--RESULT
1------A----2015---HC---------HCP1--------TRUE
1------AA---2016---HC---------HCP1--------FALSE
1------AC---2016---PC---------RED1--------FALSE
4------D----2016---OC---------RED2--------FALSE
Sep 28 '16 #1
6 926
Oralloy
988 Expert 512MB
snanjund,

What have you tried to do?

--Oralloy
Oct 2 '16 #2
ADezii
8,834 Expert 8TB
An Excel Formula approach does not immediately come to mind, but the following Macro will work assuming the Worksheet is named Sheet1 and the SUBCATEGORY Values start in Row# 2/Column# 5:
Expand|Select|Wrap|Line Numbers
  1. Dim sht As Excel.Worksheet
  2. Dim intRow As Integer
  3.  
  4. Set sht = ActiveWorkbook.Worksheets("Sheet1")
  5.  
  6. intRow = 2
  7.  
  8. With sht
  9.   Do While .Cells(intRow, "E") <> ""
  10.     'Assuming Categories start in Row# 2/Column# 5
  11.     If .Cells(intRow, "E").Value = .Cells(intRow + 1, "E") Then
  12.       .Cells(intRow, "F") = "TRUE"
  13.     Else
  14.       .Cells(intRow, "F") = "FALSE"
  15.     End If
  16.       intRow = intRow + 1
  17.   Loop
  18. End With
  19.  
Oct 2 '16 #3
HI ADezii,

Many thanks for your response..

can we do same in MS access database, as i have around 2+ lakhs data line items.. and i am also performing few calculation in access database, so that this will help me if i loop of cells in Access database.

waiting for your feedback :)
Oct 3 '16 #4
HI Orally,

i want to perform this in MS access database..

could you help help how can i resolve this.

waiting for you feedback many thanks
Oct 3 '16 #5
ADezii
8,834 Expert 8TB
Need a little more of an explanation than that which you have provided.
Oct 3 '16 #6
HI Adezii,

is there any possible way that i can fix this using ACCESS DATA BASE instead of excel VBA...

i have data around 2lakhs rows if i perform this operation in excel using VBA it takes time. so i want to fix this requirement in access data base.
Oct 4 '16 #7

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

Similar topics

5
by: coolsti | last post by:
Can someone tell me how to do this if it is possible? I have a table based web site, and I would like to dynamically change the text that is shown in a particular cell of a table. I give the cell...
3
by: Peter Williams | last post by:
Hi All, I want to write some javascript for a html page which does the following. Imagine that the page contains a table with 2 columns and 3 rows, e.g.: +---+---+ | A | B | +---+---+
16
by: quickcur | last post by:
here is my css table#bartb { border : 1px solid; width : 100%; } table#bartb td { border : 1px solid; color : #ffffff;
1
by: laj | last post by:
I'm new . I have a table with student names and than several fields with classes and all have 'yes/no'. Want to query the table to give total for 'yes's in a field. ie how many students (with...
1
by: Thanks | last post by:
I have a routine that is called on Page_Init. It retrieves folder records from a database which I display as Link Buttons in a table cell. I set the table cell's bgcolor to a default color (say...
7
by: steve marchant | last post by:
trying to learn VB6. Simple counting loop which counts to 8 in 1 sec intervals, then starts from 1 again and repeats. Have two Command buttons on the form. Cmd1 starts the counting, and I need to...
2
by: SpreadTooThin | last post by:
Hi I need to get a for loop to give me an element from a list and an index number... for example: i = 0 l = for e in l: print l, i i = i + 1
3
by: ankitks | last post by:
Hi guys, is there any utility available as a protection against endless_loop() something like this: alarm.set(5); //set timeout for 5 sec endless_loop(); alarm.reset(); //reset it to 0,...
9
by: V | last post by:
Hello: Consider the following nested for loop: uint64 TABLE; for (i=0; i<=7; i++) for (j=1; j<=7; j++) for (k=1; k<=(1<<j)-1; k++) TABLE = (TABLE) ^ (TABLE);
5
by: dave816 | last post by:
Sorry for the Excel question in an Access forum...................I don't see an Excel forum and there's probably a reason for that but figured I'd give this a shot anyway. Again sorry, delete if...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.