Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6255013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T14:17:10+00:00 2026-05-24T14:17:10+00:00

Sub omnama() ActiveSheet.Range(Cells($1, $A), Cells($39930, $Q))._ RemoveDuplicates Columns:=Array(1, 2, 6, 7, 8, 9), Header:=xlYes

  • 0
Sub omnama()
ActiveSheet.Range(Cells("$1", "$A"), Cells("$39930", "$Q"))._
RemoveDuplicates Columns:=Array(1, 2, 6, 7, 8, 9), Header:=xlYes
End Sub

This is the code to remove the duplicates I have seen and my question is,
I wanna give a variable rather Than a number

cells("$39930","$Q") should be replaced with the below code
cells("$variable"),"$Q"))  but gives the error Type mismatch -- run time error 13

How do I make it work?
If i say

cells($variable,"$Q") ' says that invalid character

So how do i put a variable Value for these above code. Please let me know.Thank you in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T14:17:11+00:00Added an answer on May 24, 2026 at 2:17 pm

    Try something like this:

    Sub omnama()
    
    Dim intRow as integer
    
    intRow = 39930
    
    ActiveSheet.Range(Cells("$1", "$A"), Cells("$" & CStr(intRow), "$Q"))._
    RemoveDuplicates Columns:=Array(1, 2, 6, 7, 8, 9), Header:=xlYes
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

sub DirectoryExists { my $param = shift; # Remove first element of the array
Public Sub New(ByVal log As Entities.LogSystem) InitializeComponent() Me.DataContext = log End Sub This is
Given this: Public Sub timReminder_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) If DateTime.Now()
Private Sub sendemail(esubj) Sheets(Actual).Select myfridate = Cells(1, 3).Value myfridate = DateAdd(d, -2, myfdate) myfridate
Because apparently everyone hates sub selects, I would like to do this using joins.
I have a VBA Sub that create and handle an array: Option Base 1
I have this (sub)object called products.original . which I then extract to a new
Sub StoragevsQuota() Charts.Add ActiveChart.ChartType = xlColumnClustered ActiveChart.SetSourceData Source:=Sheets(Data).Range(E1:G32) ActiveChart.Location Where:=xlLocationAsObject, Name:=Storage Charts ActiveChart.Parent.Name =
Private Sub importClipboard_Click() Dim data As Collection data = getClipboardData() ...do something... End Sub
let sub (m:double[],n:double[]) : double[]= [| for i = 0 to Array.length m -1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.